allow focus to disappear to black holes. (that is, windows not managed by openbox). the black hole may just be a window on another monitor. keyboard events aren't going to work in this scenario, though.
This commit is contained in:
parent
e227ac841e
commit
fd382fcc36
2 changed files with 19 additions and 6 deletions
|
@ -333,6 +333,11 @@ static gboolean wanted_focusevent(XEvent *e)
|
||||||
if (detail == NotifyNonlinearVirtual)
|
if (detail == NotifyNonlinearVirtual)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
/* This means focus reverted off of a client */
|
||||||
|
if (detail == NotifyPointerRoot || detail == NotifyDetailNone ||
|
||||||
|
detail == NotifyInferior)
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
/* Otherwise.. */
|
/* Otherwise.. */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -657,17 +662,25 @@ static void event_handle_client(ObClient *client, XEvent *e)
|
||||||
/* Look for the followup FocusIn */
|
/* Look for the followup FocusIn */
|
||||||
if (!XCheckIfEvent(ob_display, &ce, look_for_focusin, NULL)) {
|
if (!XCheckIfEvent(ob_display, &ce, look_for_focusin, NULL)) {
|
||||||
/* There is no FocusIn, this means focus went to a window that
|
/* There is no FocusIn, this means focus went to a window that
|
||||||
is not being managed. most likely, this went to PointerRoot
|
is not being managed, or a window on another screen. */
|
||||||
or None, meaning the window is no longer around so fallback
|
|
||||||
focus, but not to that window */
|
|
||||||
ob_debug("Focus went to a black hole !\n");
|
ob_debug("Focus went to a black hole !\n");
|
||||||
focus_fallback(FALSE);
|
|
||||||
} else if (ce.xany.window == e->xany.window) {
|
} else if (ce.xany.window == e->xany.window) {
|
||||||
/* If focus didn't actually move anywhere, there is nothing to do*/
|
/* If focus didn't actually move anywhere, there is nothing to do*/
|
||||||
break;
|
break;
|
||||||
|
} else if (ce.xfocus.detail == NotifyPointerRoot ||
|
||||||
|
ce.xfocus.detail == NotifyDetailNone) {
|
||||||
|
ob_debug("Focus went to root\n");
|
||||||
|
/* Focus has been reverted to the root window or nothing, so fall
|
||||||
|
back to something other than the window which just had it. */
|
||||||
|
focus_fallback(FALSE);
|
||||||
|
} else if (ce.xfocus.detail == NotifyInferior) {
|
||||||
|
ob_debug("Focus went to parent\n");
|
||||||
|
/* Focus has been reverted to parent, which is our frame window,
|
||||||
|
so fall back to something other than the window which had it. */
|
||||||
|
focus_fallback(FALSE);
|
||||||
} else {
|
} else {
|
||||||
/* Focus did move, so process the FocusIn event */
|
/* Focus did move, so process the FocusIn event */
|
||||||
ObEventData ed;
|
ObEventData ed = { .ignored = FALSE };
|
||||||
event_process(&ce, &ed);
|
event_process(&ce, &ed);
|
||||||
if (ed.ignored) {
|
if (ed.ignored) {
|
||||||
/* The FocusIn was ignored, this means it was on a window
|
/* The FocusIn was ignored, this means it was on a window
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
/*! The event mask to grab on the root window */
|
/*! The event mask to grab on the root window */
|
||||||
#define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \
|
#define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \
|
||||||
EnterWindowMask | LeaveWindowMask | \
|
EnterWindowMask | LeaveWindowMask | \
|
||||||
SubstructureRedirectMask | \
|
SubstructureRedirectMask | FocusChangeMask | \
|
||||||
ButtonPressMask | ButtonReleaseMask | ButtonMotionMask)
|
ButtonPressMask | ButtonReleaseMask | ButtonMotionMask)
|
||||||
|
|
||||||
guint screen_num_desktops;
|
guint screen_num_desktops;
|
||||||
|
|
Loading…
Reference in a new issue