From 95f4085bcda3c1e646ebb19f6c5e07b0873ab45b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sun, 3 May 2009 00:23:12 +0200 Subject: [PATCH] Raise clients only relatively to the one which was focused before. This should fix ticket #31. --- src/layout.c | 5 ----- src/util.c | 7 +++++++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/layout.c b/src/layout.c index a3690ad6..4c18989f 100644 --- a/src/layout.c +++ b/src/layout.c @@ -354,11 +354,6 @@ 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; - 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) { /* If the client is in fullscreen mode, it does not get reconfigured */ diff --git a/src/util.c b/src/util.c index 276f76f9..e16fd847 100644 --- a/src/util.c +++ b/src/util.c @@ -294,6 +294,13 @@ void set_focus(xcb_connection_t *conn, Client *client, bool set_anyways) { one than old_client */ Client *last_focused = get_last_focused_client(conn, client->container, NULL); + /* In stacking containers, raise the client in respect to the one which was focused before */ + if (client->container->mode == MODE_STACK && last_focused != NULL) { + LOG("raising\n"); + uint32_t values[] = { last_focused->frame, XCB_STACK_MODE_ABOVE }; + xcb_configure_window(conn, client->frame, XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE, values); + } + /* If it is the same one as old_client, we save us the unnecessary redecorate */ if ((last_focused != NULL) && (last_focused != old_client)) redecorate_window(conn, last_focused); -- 2.39.2