ignore focus events on root that we don't care about
This commit is contained in:
parent
fd382fcc36
commit
c4446bebff
1 changed files with 14 additions and 2 deletions
|
@ -312,6 +312,7 @@ static gboolean wanted_focusevent(XEvent *e)
|
||||||
{
|
{
|
||||||
gint mode = e->xfocus.mode;
|
gint mode = e->xfocus.mode;
|
||||||
gint detail = e->xfocus.detail;
|
gint detail = e->xfocus.detail;
|
||||||
|
Window win = e->xany.window;
|
||||||
|
|
||||||
if (e->type == FocusIn) {
|
if (e->type == FocusIn) {
|
||||||
|
|
||||||
|
@ -326,6 +327,14 @@ static gboolean wanted_focusevent(XEvent *e)
|
||||||
|
|
||||||
/* These are the ones we want.. */
|
/* 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 */
|
/* This means focus moved from the root window to a client */
|
||||||
if (detail == NotifyVirtual)
|
if (detail == NotifyVirtual)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -334,8 +343,7 @@ static gboolean wanted_focusevent(XEvent *e)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* This means focus reverted off of a client */
|
/* This means focus reverted off of a client */
|
||||||
if (detail == NotifyPointerRoot || detail == NotifyDetailNone ||
|
if (detail == NotifyInferior)
|
||||||
detail == NotifyInferior)
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
/* Otherwise.. */
|
/* Otherwise.. */
|
||||||
|
@ -350,6 +358,10 @@ static gboolean wanted_focusevent(XEvent *e)
|
||||||
if (mode == NotifyGrab)
|
if (mode == NotifyGrab)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
/* Focus left the root window revertedto state */
|
||||||
|
if (win == RootWindow(ob_display, ob_screen))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
/* These are the ones we want.. */
|
/* These are the ones we want.. */
|
||||||
|
|
||||||
/* This means focus moved from a client to the root window */
|
/* This means focus moved from a client to the root window */
|
||||||
|
|
Loading…
Reference in a new issue