focus_in = NULL;
if (client == focus_out)
focus_out = NULL;
+ if (client == focus_hilite)
+ focus_hilite = NULL;
}
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;
}
e->type == MotionNotify)
mouse_event(client, e);
else if (e->type == KeyPress)
- keyboard_event((focus_hilite ?
- focus_hilite : client), e);
+ keyboard_event((focus_cycle_target ? focus_cycle_target :
+ (focus_hilite ? focus_hilite : client)),
+ e);
}
}
}