]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: When there’s nothing to focus, focus the root window (Thanks fernandotcl...
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 19 Mar 2011 19:43:06 +0000 (20:43 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 19 Mar 2011 19:43:06 +0000 (20:43 +0100)
src/x.c

diff --git a/src/x.c b/src/x.c
index b63e99e6c7163e2febf0ec82290b660eeb1f605f..188be5fb09246725c3bb5a241db5ff249e17d284 100644 (file)
--- a/src/x.c
+++ b/src/x.c
@@ -651,6 +651,12 @@ void x_push_changes(Con *con) {
         }
     }
 
+    if (focused_id == XCB_NONE) {
+        DLOG("Still no window focused, better set focus to the root window\n");
+        xcb_set_input_focus(conn, XCB_INPUT_FOCUS_POINTER_ROOT, root, XCB_CURRENT_TIME);
+        focused_id = root;
+    }
+
     xcb_flush(conn);
     DLOG("\n\n ENDING CHANGES\n\n");