From: Michael Stapelberg Date: Tue, 21 Jul 2009 13:49:08 +0000 (+0200) Subject: Bugfix: Correctly redecorate clients when changing focus (Thanks msi) X-Git-Tag: 3.d-bf1~58 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af4d2e6d4e990c6642c27ab6c6faec31e55b9253;p=i3%2Fi3 Bugfix: Correctly redecorate clients when changing focus (Thanks msi) When moving your cursor from one tiling window to another tiling window via a floating client, the old tiling window was not re- decorated correctly --- diff --git a/src/util.c b/src/util.c index bccb9941..f2e1a96f 100644 --- a/src/util.c +++ b/src/util.c @@ -367,6 +367,22 @@ void set_focus(xcb_connection_t *conn, Client *client, bool set_anyways) { if ((old_client != NULL) && (old_client != client) && !old_client->dock) redecorate_window(conn, old_client); + /* If the last client was a floating client, we need to go to the next + * tiling client in stack and re-decorate it. */ + if (client_is_floating(old_client)) { + LOG("Coming from floating client, searching next tiling...\n"); + Client *current; + SLIST_FOREACH(current, &(client->workspace->focus_stack), focus_clients) { + if (client_is_floating(current)) + continue; + + LOG("Found window: %p / child %p\n", current->frame, current->child); + redecorate_window(conn, current); + break; + } + + } + SLIST_REMOVE(&(client->workspace->focus_stack), client, Client, focus_clients); SLIST_INSERT_HEAD(&(client->workspace->focus_stack), client, focus_clients);