ignore focus events on root that we don't care about
Dana Jansens danakj@orodu.net
1 files changed,
14 insertions(+),
2 deletions(-)
jump to
M
openbox/event.c
→
openbox/event.c
@@ -312,6 +312,7 @@ static gboolean wanted_focusevent(XEvent *e)
{ gint mode = e->xfocus.mode; gint detail = e->xfocus.detail; + Window win = e->xany.window; if (e->type == FocusIn) {@@ -326,6 +327,14 @@ return FALSE;
/* 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;@@ -334,8 +343,7 @@ if (detail == NotifyNonlinearVirtual)
return TRUE; /* This means focus reverted off of a client */ - if (detail == NotifyPointerRoot || detail == NotifyDetailNone || - detail == NotifyInferior) + if (detail == NotifyInferior) return TRUE; /* Otherwise.. */@@ -348,6 +356,10 @@ /* These are ones we never want.. */
/* This means focus was taken by a keyboard/mouse grab. */ 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.. */