]> git.sur5r.net Git - i3/i3/commitdiff
Revert 43d471b9ab736f5ff5b458a672d54319e3366464 and apply correct bugfix:
authorMichael Stapelberg <michael+git@stapelberg.de>
Sat, 28 Feb 2009 01:36:40 +0000 (02:36 +0100)
committerMichael Stapelberg <michael+git@stapelberg.de>
Sat, 28 Feb 2009 01:40:07 +0000 (02:40 +0100)
Before, all clients were reconfigured to just raise them, when focus should
be set. However, this generated lots of notify events, which in turn lead
to an endless loop of setting focus, reconfiguring, setting focus, …

src/handlers.c
src/layout.c
src/util.c

index 32b0b03cef673c4b00158f29ab98366d218ef2a0..6b9ac7f19409fae67eccfb7ec7515974d3d3b91f 100644 (file)
@@ -110,11 +110,6 @@ int handle_enter_notify(void *ignored, xcb_connection_t *conn, xcb_enter_notify_
                 return 1;
         }
 
-        /* When in stacking, enter notifications on the parent are ignored. Focus will be changed via keyboard only. */
-        if (client->container->mode == MODE_STACK &&
-            client == table_get(byParent, event->event))
-                return 1;
-
         set_focus(conn, client);
 
         return 1;
index c1386778f099bedcd15d3cdfb6cfcb341915139f..a3935996d9dc7920ae88cec6eb8ef63323f2b151 100644 (file)
@@ -232,27 +232,31 @@ void render_container(xcb_connection_t *connection, Container *container) {
                         xcb_configure_window(connection, stack_win->window,
                                 XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT, &(stack_win->width));
 
-                /* All clients are repositioned */
-                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 |
-                            (client->rect.x != (client->rect.x = container->x)) |
-                            (client->rect.y != (client->rect.y = container->y + (decoration_height * num_clients))))
-                                reposition_client(connection, client);
+                /* Reconfigure the currently focused client, if necessary. It is the only visible one */
+                client = container->currently_focused;
 
-                        if (client->force_reconfigure |
-                            (client->rect.width != (client->rect.width = container->width)) |
-                            (client->rect.height !=
-                             (client->rect.height = container->height - (decoration_height * num_clients))))
-                                resize_client(connection, client);
+                /* 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 |
+                    (client->rect.x != (client->rect.x = container->x)) |
+                    (client->rect.y != (client->rect.y = container->y + (decoration_height * num_clients))))
+                        reposition_client(connection, client);
 
-                        client->force_reconfigure = false;
+                if (client->force_reconfigure |
+                    (client->rect.width != (client->rect.width = container->width)) |
+                    (client->rect.height !=
+                     (client->rect.height = container->height - (decoration_height * num_clients))))
+                        resize_client(connection, client);
 
+                client->force_reconfigure = false;
+
+                uint32_t values[] = { XCB_STACK_MODE_ABOVE };
+                xcb_configure_window(connection, client->frame, XCB_CONFIG_WINDOW_STACK_MODE, values);
+
+                /* Render the decorations of all clients */
+                CIRCLEQ_FOREACH(client, &(container->clients), clients)
                         decorate_window(connection, client, stack_win->window, stack_win->gc,
-                                        current_client * decoration_height);
-                        current_client++;
-                }
+                                        current_client++ * decoration_height);
         }
 }
 
index d565508b5aa9965ca66ce432c09865c39c1dbd85..a25e63763d191114b188be02264839e60f81d592 100644 (file)
@@ -149,13 +149,9 @@ void set_focus(xcb_connection_t *conn, Client *client) {
         decorate_window(conn, client, client->frame, client->titlegc, 0);
 
         /* If we’re in stacking mode, we render the container to update changes in the title
-           bars and raise the focused client */
-        if (client->container->mode == MODE_STACK) {
+           bars and to raise the focused client */
+        if (client->container->mode == MODE_STACK)
                 render_container(conn, client->container);
-                uint32_t values[] = { XCB_STACK_MODE_ABOVE };
-                xcb_configure_window(conn, client->frame,
-                                     XCB_CONFIG_WINDOW_STACK_MODE, values);
-        }
 
         xcb_flush(conn);
 }
@@ -193,11 +189,6 @@ void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode)
                 stack_win->container = container;
 
                 SLIST_INSERT_HEAD(&stack_wins, stack_win, stack_windows);
-                /* Raise the focused window */
-                values[0] = XCB_STACK_MODE_ABOVE;
-                xcb_configure_window(conn, container->currently_focused->frame,
-                                     XCB_CONFIG_WINDOW_STACK_MODE, values);
-
         } else {
                 if (container->mode == MODE_STACK) {
                         /* When going out of stacking mode, we need to close the window */