]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Make sure floating clients are alwalys above tiling clients (Thanks Mirko)
authorMichael Stapelberg <michael@stapelberg.de>
Fri, 19 Jun 2009 20:57:19 +0000 (22:57 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Fri, 19 Jun 2009 20:57:19 +0000 (22:57 +0200)
src/floating.c
src/manage.c

index f455739cd20350098ca9b53b4458fad8c8187f19..f416160a4e4ba5400c13d9c058549fdc067e3e50 100644 (file)
@@ -78,6 +78,14 @@ void toggle_floating_mode(xcb_connection_t *conn, Client *client, bool automatic
                 LOG("Re-inserted the client into the matrix.\n");
                 con->currently_focused = client;
 
+                /* Ensure that it is below all floating clients */
+                Client *first_floating = TAILQ_FIRST(&(client->workspace->floating_clients));
+                if (first_floating != TAILQ_END(&(client->workspace->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);
+                }
+
                 render_container(conn, con);
                 xcb_flush(conn);
 
index dfbe12ccd5abd1bd5d4e7764d43e242697918d49..827c05ca870ed037c8c92dda4add89fbf9d8e158 100644 (file)
@@ -374,12 +374,8 @@ void reparent_window(xcb_connection_t *conn, xcb_window_t child,
                 SLIST_INSERT_HEAD(&(new->container->workspace->focus_stack), new, focus_clients);
 
                 /* Ensure that it is below all floating clients */
-                Client *first_floating;
-                SLIST_FOREACH(first_floating, &(new->container->workspace->focus_stack), focus_clients)
-                        if (first_floating->floating >= FLOATING_AUTO_ON)
-                                break;
-
-                if (first_floating != SLIST_END(&(new->container->workspace->focus_stack))) {
+                Client *first_floating = TAILQ_FIRST(&(new->workspace->floating_clients));
+                if (first_floating != TAILQ_END(&(new->workspace->floating_clients))) {
                         LOG("Setting below floating\n");
                         uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW };
                         xcb_configure_window(conn, new->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);