summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-03-21 16:12:21 +0000
committerDana Jansens <danakj@orodu.net>2007-03-21 16:12:21 +0000
commitc4446bebff57d6e1bc9185d1f03aa5cc1995ddae (patch)
tree2ff2c84ae04e3240e26b49883c5c8ca4fc5f8289
parentfd382fcc36552614176c929c1a1a687fb52c0da0 (diff)
ignore focus events on root that we don't care about
-rw-r--r--openbox/event.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/openbox/event.c b/openbox/event.c
index 2ce29d5c..b5703782 100644
--- a/openbox/event.c
+++ b/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 @@ static gboolean wanted_focusevent(XEvent *e)
/* 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 @@ static gboolean wanted_focusevent(XEvent *e)
return TRUE;
/* This means focus reverted off of a client */
- if (detail == NotifyPointerRoot || detail == NotifyDetailNone ||
- detail == NotifyInferior)
+ if (detail == NotifyInferior)
return TRUE;
/* Otherwise.. */
@@ -350,6 +358,10 @@ static gboolean wanted_focusevent(XEvent *e)
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 */