Bugfix: Make sure floating clients are alwalys above tiling clients (Thanks Mirko)

This commit is contained in:
Michael Stapelberg 2009-06-19 22:57:19 +02:00
parent 589a73c8ea
commit 5c0496a3ef
2 changed files with 10 additions and 6 deletions

View 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"); LOG("Re-inserted the client into the matrix.\n");
con->currently_focused = client; 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); render_container(conn, con);
xcb_flush(conn); xcb_flush(conn);

View 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); SLIST_INSERT_HEAD(&(new->container->workspace->focus_stack), new, focus_clients);
/* Ensure that it is below all floating clients */ /* Ensure that it is below all floating clients */
Client *first_floating; Client *first_floating = TAILQ_FIRST(&(new->workspace->floating_clients));
SLIST_FOREACH(first_floating, &(new->container->workspace->focus_stack), focus_clients) if (first_floating != TAILQ_END(&(new->workspace->floating_clients))) {
if (first_floating->floating >= FLOATING_AUTO_ON)
break;
if (first_floating != SLIST_END(&(new->container->workspace->focus_stack))) {
LOG("Setting below floating\n"); LOG("Setting below floating\n");
uint32_t values[] = { first_floating->frame, XCB_STACK_MODE_BELOW }; 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); xcb_configure_window(conn, new->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values);