From: Dana Jansens Date: Sun, 12 Oct 2003 20:28:35 +0000 (+0000) Subject: allow focus to be moved off top level managed windows, as long as its not None or... X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=568744d572c68c164492096f2fbe2ea3ae291170;p=chaz%2Fopenbox allow focus to be moved off top level managed windows, as long as its not None or the root. --- diff --git a/openbox/event.c b/openbox/event.c index 05024e72..bb138d3d 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -355,8 +355,15 @@ static void event_done(gpointer data) focus_hilite = focus_in; if (focus_client != last) { - if (!focus_client) - focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); + if (!focus_client) { + Window w; + int r; + + /* is focus anywhere valid? */ + XGetInputFocus(ob_display, &w, &r); + if (!w || w == RootWindow(ob_display, ob_screen)) + focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); + } last = focus_client; }