]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Reconfigure all clients in stacking, correctly ignore events, event when...
authorMichael Stapelberg <michael+x200@stapelberg.de>
Wed, 4 Mar 2009 21:41:04 +0000 (22:41 +0100)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Wed, 4 Mar 2009 21:41:04 +0000 (22:41 +0100)
src/handlers.c
src/layout.c

index 22140e9e7466b5d46e862df5e1cc8498e59077a2..4c9a6584d37a5e34ddca3a809cebe849fffa1cdc 100644 (file)
@@ -338,6 +338,7 @@ int handle_map_notify_event(void *prophs, xcb_connection_t *conn, xcb_map_notify
         window_attributes_t wa = { TAG_VALUE };
         wa.u.override_redirect = event->override_redirect;
         printf("MapNotify for 0x%08x, serial is %d.\n", event->window, event->sequence);
+        printf("setting ignore_notify_event = %d\n", event->sequence);
         ignore_notify_event = event->sequence;
         manage_window(prophs, conn, event->window, wa);
         return 1;
@@ -353,14 +354,16 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n
 
         printf("handle_configure_event\n");
         printf("event->x = %d, ->y = %d, ->width = %d, ->height = %d\n", event->x, event->y, event->width, event->height);
+        printf("sequence = %d\n", event->sequence);
+
+        ignore_notify_event = event->sequence;
+
         if (event->event == root) {
                 printf("reconfigure of the root window, need to xinerama\n");
                 xinerama_requery_screens(conn);
                 return 1;
         }
 
-        ignore_notify_event = event->sequence;
-
         Client *client = table_get(byChild, event->window);
         if (client == NULL) {
                 printf("client not managed, ignoring\n");
@@ -395,6 +398,8 @@ int handle_configure_event(void *prophs, xcb_connection_t *conn, xcb_configure_n
 int handle_unmap_notify_event(void *data, xcb_connection_t *conn, xcb_unmap_notify_event_t *event) {
         xcb_window_t root = xcb_setup_roots_iterator(xcb_get_setup(conn)).data->root;
 
+        printf("setting ignore_notify_event = %d\n", event->sequence);
+
         ignore_notify_event = event->sequence;
 
         Client *client = table_get(byChild, event->window);
index 7be9bde06fc61e4dad16efc707c37a13ebc9d259..ac3ee36149917dc02e6f942312062d3df466bf72 100644 (file)
@@ -304,29 +304,30 @@ void render_container(xcb_connection_t *conn, Container *container) {
                 /* Reconfigure the currently focused client, if necessary. It is the only visible one */
                 client = container->currently_focused;
 
-                /* Check if we changed client->x or client->y by updating it.
-                 * Note the bitwise OR instead of logical OR to force evaluation of both statements */
-                if (client->force_reconfigure |
-                    HAS_CHANGED(old_value_1, client->rect.x, container->x) |
-                    HAS_CHANGED(old_value_2, client->rect.y, container->y + (decoration_height * num_clients)))
-                        reposition_client(conn, client);
-
-                if (client->force_reconfigure |
-                    HAS_CHANGED(old_value_1, client->rect.width, container->width) |
-                    HAS_CHANGED(old_value_2, client->rect.height, container->height - (decoration_height * num_clients)))
-                        resize_client(conn, client);
-
-                client->force_reconfigure = false;
-
                 if (container->workspace->fullscreen_client == NULL) {
                         uint32_t values[] = { XCB_STACK_MODE_ABOVE };
                         xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_STACK_MODE, values);
                 }
 
                 /* Render the decorations of all clients */
-                CIRCLEQ_FOREACH(client, &(container->clients), clients)
+                CIRCLEQ_FOREACH(client, &(container->clients), clients) {
+                        /* Check if we changed client->x or client->y by updating it.
+                         * Note the bitwise OR instead of logical OR to force evaluation of both statements */
+                        if (client->force_reconfigure |
+                            HAS_CHANGED(old_value_1, client->rect.x, container->x) |
+                            HAS_CHANGED(old_value_2, client->rect.y, container->y + (decoration_height * num_clients)))
+                                reposition_client(conn, client);
+
+                        if (client->force_reconfigure |
+                            HAS_CHANGED(old_value_1, client->rect.width, container->width) |
+                            HAS_CHANGED(old_value_2, client->rect.height, container->height - (decoration_height * num_clients)))
+                                resize_client(conn, client);
+
+                        client->force_reconfigure = false;
+
                         decorate_window(conn, client, stack_win->window, stack_win->gc,
                                         current_client++ * decoration_height);
+                }
         }
 }