]> Dogcows Code - chaz/openbox/commitdiff
don't force reconfigure in a number of places, also eat enter events when reconfiguri...
authorDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 15:07:49 +0000 (15:07 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 13 Jun 2007 15:07:49 +0000 (15:07 +0000)
openbox/client.c
openbox/client.h
openbox/event.c
openbox/frame.c
openbox/openbox.c
openbox/screen.c

index 152f2316d8ae5c81312a061c4a484646fd06545b..f70ab4451fe97f62faeffd6343fa5e602d4db6ab 100644 (file)
@@ -1749,7 +1749,8 @@ void client_setup_decor_and_functions(ObClient *self, gboolean reconfig)
     client_change_allowed_actions(self);
 
     if (reconfig)
-        client_reconfigure(self);
+        /* force reconfigure to make sure decorations are updated */
+        client_reconfigure(self, TRUE);
 }
 
 static void client_change_allowed_actions(ObClient *self)
@@ -1807,11 +1808,25 @@ static void client_change_allowed_actions(ObClient *self)
     }
 }
 
-void client_reconfigure(ObClient *self)
+void client_reconfigure(ObClient *self, gboolean force)
 {
-    client_configure(self, self->area.x, self->area.y,
-                     self->area.width, self->area.height,
-                     FALSE, TRUE);
+    gint x, y, w, h, lw, lh;
+
+    /* make sure the client's sizes are within its bounds, but only
+       reconfigure the window if it needs to. emacs will update its
+       normal hints every time it receives a conigurenotify */
+        RECT_TO_DIMS(self->area, x, y, w, h);
+    if (!force)
+        client_try_configure(self, &x, &y, &w, &h, &lw, &lh, FALSE);
+    if (force || !RECT_EQUAL_DIMS(self->area, x, y, w, h)) {
+        gulong ignore_start;
+
+        ob_debug("Reconfiguring client x %d y %d w %d h %d\n",
+                 x, y, w, h);
+        ignore_start = event_start_ignore_all_enters();
+        client_configure(self, x, y, w, h, FALSE, TRUE);
+        event_end_ignore_all_enters(ignore_start);
+    }
 }
 
 void client_update_wmhints(ObClient *self)
@@ -3254,11 +3269,12 @@ void client_set_desktop_recursive(ObClient *self,
         /* raise if it was not already on the desktop */
         if (old != DESKTOP_ALL)
             stacking_raise(CLIENT_AS_WINDOW(self));
-        /* the new desktop's geometry may be different, so we may need to
-           resize, for example if we are maximized */
-        client_reconfigure(self);
         if (STRUT_EXISTS(self->strut))
             screen_update_areas();
+        else
+            /* the new desktop's geometry may be different, so we may need to
+               resize, for example if we are maximized */
+            client_reconfigure(self, FALSE);
     }
 
     /* move all transients */
index 98f9e6e41afd9441537c3daf5a5c1430b868fed8..a334ad2bf37ba1b32e1b85e8ec5478da0ce98e9f 100644 (file)
@@ -427,7 +427,7 @@ void client_try_configure(ObClient *self, gint *x, gint *y, gint *w, gint *h,
 void client_configure(ObClient *self, gint x, gint y, gint w, gint h,
                       gboolean user, gboolean final);
 
-void client_reconfigure(ObClient *self);
+void client_reconfigure(ObClient *self, gboolean force);
 
 /*! Finds coordinates to keep a client on the screen.
   @param self The client
index ccf4bb65ece5402ac0b5960fed327a6bbfa05c4b..88cccdee41a6357d3c5c2d3ee4eacc79e704bdec 100644 (file)
@@ -1434,7 +1434,7 @@ static void event_handle_client(ObClient *client, XEvent *e)
 
                     /* send a synthetic ConfigureNotify, cuz this is supposed
                        to be like a ConfigureRequest. */
-                    client_reconfigure(client);
+                    client_reconfigure(client, TRUE);
                 } else
                     ob_debug_type(OB_DEBUG_APP_BUGS,
                                   "_NET_RESTACK_WINDOW sent for window %s "
@@ -1481,27 +1481,12 @@ static void event_handle_client(ObClient *client, XEvent *e)
 
         msgtype = e->xproperty.atom;
         if (msgtype == XA_WM_NORMAL_HINTS) {
-            gint x, y, w, h, lw, lh;
-
             ob_debug("Update NORMAL hints\n");
             client_update_normal_hints(client);
             /* normal hints can make a window non-resizable */
             client_setup_decor_and_functions(client, FALSE);
 
-            /* make sure the client's sizes are within its bounds, but only
-               reconfigure the window if it needs to. emacs will update its
-               normal hints every time it receives a conigurenotify */
-            RECT_TO_DIMS(client->area, x, y, w, h);
-            client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE);
-            if (!RECT_EQUAL_DIMS(client->area, x, y, w, h)) {
-                gulong ignore_start;
-
-                ob_debug("Configuring client x %d y %d w %d h %d\n",
-                         x, y, w, h);
-                ignore_start = event_start_ignore_all_enters();
-                client_configure(client, x, y, w, h, FALSE, TRUE);
-                event_end_ignore_all_enters(ignore_start);
-            }
+            client_reconfigure(client, FALSE);
         } else if (msgtype == XA_WM_HINTS) {
             client_update_wmhints(client);
         } else if (msgtype == XA_WM_TRANSIENT_FOR) {
index 55a28413275dd8098b3c1d999be730bee741fceb..9ecee8184a6c6f4b285e770f50773ac7c73de4fe 100644 (file)
@@ -1675,7 +1675,7 @@ void frame_end_iconify_animation(ObFrame *self)
     else {
         /* Send a ConfigureNotify when the animation is done, this fixes
            KDE's pager showing the window in the wrong place. */
-        client_reconfigure(self->client);
+        client_reconfigure(self->client, TRUE);
     }
 
     /* we're not animating any more ! */
index e8d5ae4ddfab1dd05234068adbc99dcf38e46e2b..1e1e3bf0f5f6268478525550ba043c8cb46ecd42 100644 (file)
@@ -337,7 +337,7 @@ gint main(gint argc, gchar **argv)
                     frame_adjust_area(c->frame, TRUE, TRUE, FALSE);
                     /* the decor sizes may have changed, so the windows may
                        end up in new positions */
-                    client_reconfigure(c);
+                    client_reconfigure(c, FALSE);
                 }
             }
 
index 3962fd2a746b0e183c1ac94595a0a361b9e2cfdd..92d4d9a421bac5db1a62a8b59fc81cc9fee8f6b4 100644 (file)
@@ -1206,20 +1206,8 @@ void screen_update_areas()
                 dims, 4 * screen_num_desktops * screen_num_monitors);
 
     /* the area has changed, adjust all the windows if they need it */
-    for (it = client_list; it; it = g_list_next(it)) {
-        gint x, y, w, h, lw, lh;
-        ObClient *client = it->data;
-
-        RECT_TO_DIMS(client->area, x, y, w, h);
-        client_try_configure(client, &x, &y, &w, &h, &lw, &lh, FALSE);
-        if (!RECT_EQUAL_DIMS(client->area, x, y, w, h)) {
-            gulong ignore_start;
-
-            ignore_start = event_start_ignore_all_enters();
-            client_configure(client, x, y, w, h, FALSE, TRUE);
-            event_end_ignore_all_enters(ignore_start);
-        }
-    }
+    for (it = client_list; it; it = g_list_next(it))
+        client_reconfigure(it->data, FALSE);
 
     g_free(dims);
 }
This page took 0.032991 seconds and 4 git commands to generate.