refix for managing iconic windows, without having the frame map which caused flashing.
instead, keep track of if the frame has been mapped yet. if it hasn't and it is getting hidden, then make sure to unmap the child.
This commit is contained in:
parent
e2521f5c64
commit
5f7ffb00ba
3 changed files with 20 additions and 14 deletions
|
@ -2116,10 +2116,9 @@ void client_showhide(ObClient *self)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (client_should_show(self)) {
|
if (client_should_show(self)) {
|
||||||
if (!self->frame->visible)
|
frame_show(self->frame);
|
||||||
frame_show(self->frame);
|
|
||||||
}
|
}
|
||||||
else if (self->frame->visible) {
|
else {
|
||||||
frame_hide(self->frame);
|
frame_hide(self->frame);
|
||||||
|
|
||||||
/* Fall back focus since we're disappearing */
|
/* Fall back focus since we're disappearing */
|
||||||
|
|
|
@ -238,18 +238,28 @@ void frame_show(ObFrame *self)
|
||||||
self->visible = TRUE;
|
self->visible = TRUE;
|
||||||
XMapWindow(ob_display, self->client->window);
|
XMapWindow(ob_display, self->client->window);
|
||||||
XMapWindow(ob_display, self->window);
|
XMapWindow(ob_display, self->window);
|
||||||
|
self->firstmap = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void frame_hide(ObFrame *self)
|
void frame_hide(ObFrame *self)
|
||||||
{
|
{
|
||||||
if (self->visible) {
|
if (self->visible || self->firstmap == FALSE) {
|
||||||
self->visible = FALSE;
|
if (self->visible) {
|
||||||
self->client->ignore_unmaps += 2;
|
self->visible = FALSE;
|
||||||
/* we unmap the client itself so that we can get MapRequest
|
self->client->ignore_unmaps += 2;
|
||||||
events, and because the ICCCM tells us to! */
|
/* we unmap the client itself so that we can get MapRequest
|
||||||
XUnmapWindow(ob_display, self->window);
|
events, and because the ICCCM tells us to! */
|
||||||
XUnmapWindow(ob_display, self->client->window);
|
XUnmapWindow(ob_display, self->window);
|
||||||
|
XUnmapWindow(ob_display, self->client->window);
|
||||||
|
} else {
|
||||||
|
/* the frame wasn't visible, but the frame is being hidden now.
|
||||||
|
so we don't need to unmap the frame, but we do need to unmap
|
||||||
|
the client. */
|
||||||
|
self->client->ignore_unmaps += 1;
|
||||||
|
XUnmapWindow(ob_display, self->client->window);
|
||||||
|
}
|
||||||
|
self->firstmap = TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,10 +545,6 @@ void frame_grab_client(ObFrame *self, ObClient *client)
|
||||||
|
|
||||||
/* map the client so it maps when the frame does */
|
/* map the client so it maps when the frame does */
|
||||||
XMapWindow(ob_display, client->window);
|
XMapWindow(ob_display, client->window);
|
||||||
/* map the frame so they are in a consistant state together */
|
|
||||||
XMapWindow(ob_display, self->window);
|
|
||||||
/* reflect that we're initially visible */
|
|
||||||
self->visible = TRUE;
|
|
||||||
|
|
||||||
/* set all the windows for the frame in the window_map */
|
/* set all the windows for the frame in the window_map */
|
||||||
g_hash_table_insert(window_map, &self->window, client);
|
g_hash_table_insert(window_map, &self->window, client);
|
||||||
|
|
|
@ -76,6 +76,7 @@ struct _ObFrame
|
||||||
Strut size;
|
Strut size;
|
||||||
Rect area;
|
Rect area;
|
||||||
gboolean visible;
|
gboolean visible;
|
||||||
|
gboolean firstmap;
|
||||||
|
|
||||||
/*! Whether the window is obscured at all or fully visible. */
|
/*! Whether the window is obscured at all or fully visible. */
|
||||||
gboolean obscured;
|
gboolean obscured;
|
||||||
|
|
Loading…
Reference in a new issue