{
gint mode = e->xfocus.mode;
gint detail = e->xfocus.detail;
+ Window win = e->xany.window;
if (e->type == FocusIn) {
/* These are the ones we want.. */
+ if (win == RootWindow(ob_display, ob_screen)) {
+ /* This means focus reverted off of a client */
+ if (detail == NotifyPointerRoot || detail == NotifyDetailNone)
+ return TRUE;
+ else
+ return FALSE;
+ }
+
/* This means focus moved from the root window to a client */
if (detail == NotifyVirtual)
return TRUE;
return TRUE;
/* This means focus reverted off of a client */
- if (detail == NotifyPointerRoot || detail == NotifyDetailNone ||
- detail == NotifyInferior)
+ if (detail == NotifyInferior)
return TRUE;
/* Otherwise.. */
if (mode == NotifyGrab)
return FALSE;
+ /* Focus left the root window revertedto state */
+ if (win == RootWindow(ob_display, ob_screen))
+ return FALSE;
+
/* These are the ones we want.. */
/* This means focus moved from a client to the root window */