]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Don’t update focus when container is not mapped
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 11 Dec 2010 16:07:20 +0000 (17:07 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 11 Dec 2010 16:07:20 +0000 (17:07 +0100)
src/x.c

diff --git a/src/x.c b/src/x.c
index 979b873418b1ffe741ba1fbe292517ac92bc21ac..fa0030200e3acf95e8028bfa2a71d51cdd074892 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -589,10 +589,15 @@ void x_push_changes(Con *con) {
     if (focused->window != NULL)
         to_focus = focused->window->id;
 
+    DLOG("focused_id = 0x%08x, to_focus = 0x%08x\n", focused_id, to_focus);
     if (focused_id != to_focus) {
-        LOG("Updating focus (focused: %p / %s)\n", focused, focused->name);
-        xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, to_focus, XCB_CURRENT_TIME);
-        focused_id = to_focus;
+        if (!focused->mapped) {
+            DLOG("Not updating focus (to %p / %s), focused window is not mapped.\n", focused, focused->name);
+        } else {
+            LOG("Updating focus (focused: %p / %s)\n", focused, focused->name);
+            xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, to_focus, XCB_CURRENT_TIME);
+            focused_id = to_focus;
+        }
     }
 
     xcb_flush(conn);