]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: also invalidate focused_id when the to_focus window is not mapped
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 19 Mar 2011 21:54:53 +0000 (22:54 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 19 Mar 2011 21:54:53 +0000 (22:54 +0100)
This fixes a bug where focus might not be set correctly when changing workspaces

src/x.c

diff --git a/src/x.c b/src/x.c
index 8af2e62e83a503836d39ebcc1cf0b4b80b84c1fc..444b39ac1eec6cf569e043fb2d038dd61f15e236 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -637,6 +637,8 @@ void x_push_changes(Con *con) {
     if (focused_id != to_focus) {
         if (!focused->mapped) {
             DLOG("Not updating focus (to %p / %s), focused window is not mapped.\n", focused, focused->name);
+            /* Invalidate focused_id to correctly focus new windows with the same ID */
+            focused_id = XCB_NONE;
         } else {
             DLOG("Updating focus (focused: %p / %s)\n", focused, focused->name);
             xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, to_focus, XCB_CURRENT_TIME);