From 8b9aedd2bfbd30e078ca68176c4646e562e1ac66 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 19 Mar 2011 20:43:06 +0100 Subject: [PATCH] =?UTF-8?q?Bugfix:=20When=20there=E2=80=99s=20nothing=20to?= =?UTF-8?q?=20focus,=20focus=20the=20root=20window=20(Thanks=20fernandotcl?= =?UTF-8?q?,=20ThePub)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/x.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/x.c b/src/x.c index b63e99e6..188be5fb 100644 --- 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");