]> Dogcows Code - chaz/openbox/commitdiff
refix for managing iconic windows, without having the frame map which caused flashing.
authorDana Jansens <danakj@orodu.net>
Wed, 14 Mar 2007 13:58:36 +0000 (13:58 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 14 Mar 2007 13:58:36 +0000 (13:58 +0000)
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.

openbox/client.c
openbox/frame.c
openbox/frame.h

index f5e600a23561ba2b7a975638dfdcead4daf4c9eb..1a0d2531c23423f63bd324eef262c76654a8cf23 100644 (file)
@@ -2116,10 +2116,9 @@ void client_showhide(ObClient *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);
 
         /* Fall back focus since we're disappearing */
index 9a506d15560ebf56b8a28321348c4e7ba99f01bd..3fd8b22a69e06bf01e59bbe450295f56d7850e71 100644 (file)
@@ -238,18 +238,28 @@ void frame_show(ObFrame *self)
         self->visible = TRUE;
         XMapWindow(ob_display, self->client->window);
         XMapWindow(ob_display, self->window);
+        self->firstmap = TRUE;
     }
 }
 
 void frame_hide(ObFrame *self)
 {
-    if (self->visible) {
-        self->visible = FALSE;
-        self->client->ignore_unmaps += 2;
-        /* we unmap the client itself so that we can get MapRequest
-           events, and because the ICCCM tells us to! */
-        XUnmapWindow(ob_display, self->window);
-        XUnmapWindow(ob_display, self->client->window);
+    if (self->visible || self->firstmap == FALSE) {
+        if (self->visible) {
+            self->visible = FALSE;
+            self->client->ignore_unmaps += 2;
+            /* we unmap the client itself so that we can get MapRequest
+               events, and because the ICCCM tells us to! */
+            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 */
     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 */
     g_hash_table_insert(window_map, &self->window, client);
index 0d04436630fa467c3f0d656c270d96dd43b371c7..70855b1b8156e79d4c8f5dd6cc856ece627b07aa 100644 (file)
@@ -76,6 +76,7 @@ struct _ObFrame
     Strut     size;
     Rect      area;
     gboolean  visible;
+    gboolean  firstmap;
 
     /*! Whether the window is obscured at all or fully visible. */
     gboolean obscured;
This page took 0.029684 seconds and 4 git commands to generate.