X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=bb138d3dca77815f0766410e492776f7bf4be2fb;hb=90abec9c3017f05b14f85d85105df0c62622ad9a;hp=05024e72a9a59eaffc83debe8ef1461ebab86654;hpb=7ca410e66357706e36ea740b49d899be832da671;p=chaz%2Fopenbox 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; }