]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Correctly place new windows below fullscreen windows (Thanks Moredread)
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 12 Dec 2009 20:29:07 +0000 (21:29 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 12 Dec 2009 20:29:07 +0000 (21:29 +0100)
This bug could happen if you have floating and tiling windows (for
example Firefox in tiling mode and its Open dialog in autmatically
floating mode) and you opened a new tiling window while in fullscreen.

i3 would then place the window below the floating windows, but
floating clients are above fullscreen windows. Thus, the client
would be placed above the fullscreen window.

src/client.c

index c0031d7188abdb3fbdd1185e710cbb49f43401a7..b686a1ae7be3b83e497a0afec1c78d07773b113d 100644 (file)
@@ -239,11 +239,20 @@ void client_set_below_floating(xcb_connection_t *conn, Client *client) {
         /* Ensure that it is below all floating clients */
         Workspace *ws = client->workspace;
         Client *first_floating = TAILQ_FIRST(&(ws->floating_clients));
-        if (first_floating != TAILQ_END(&(ws->floating_clients))) {
-                LOG("Setting below floating\n");
-                uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW };
-                xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
-        }
+        if (first_floating == TAILQ_END(&(ws->floating_clients)))
+                return;
+
+        LOG("Setting below floating\n");
+        uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW };
+        xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
+
+        if (client->workspace->fullscreen_client == NULL)
+                return;
+
+        LOG("(and below fullscreen)\n");
+        /* Ensure that the window is still below the fullscreen window */
+        values[0] = client->workspace->fullscreen_client->frame;
+        xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);
 }
 
 /*