From: Michael Stapelberg Date: Sat, 19 Mar 2011 19:43:06 +0000 (+0100) Subject: Bugfix: When there’s nothing to focus, focus the root window (Thanks fernandotcl... X-Git-Tag: tree-pr3~109 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8b9aedd2bfbd30e078ca68176c4646e562e1ac66;p=i3%2Fi3 Bugfix: When there’s nothing to focus, focus the root window (Thanks fernandotcl, ThePub) --- 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");