better fix for focus going to the frame window when iconifying with RevertToParent. Treat the focus in like a focus out.
When focus moves to a window that doesn't exist, need to set the focus_client to NULL otherwise the client that lost focus won't know and won't update its decor
This commit is contained in:
parent
c768a7dae7
commit
dcb76cac8f
1 changed files with 22 additions and 11 deletions
|
@ -363,13 +363,6 @@ static gboolean wanted_focusevent(XEvent *e, gboolean in_client_only)
|
||||||
/* This means focus moved from one client to another */
|
/* This means focus moved from one client to another */
|
||||||
if (detail == NotifyNonlinearVirtual)
|
if (detail == NotifyNonlinearVirtual)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
/* This means focus moved off of our frame window.
|
|
||||||
When the client reverts to parent and it lands on our frame window,
|
|
||||||
and they are iconifying (not being unmanaged), then we don't get
|
|
||||||
a focus out from the client but only from the frame window, which
|
|
||||||
is this event */
|
|
||||||
if (detail == NotifyNonlinear)
|
|
||||||
return TRUE;
|
|
||||||
|
|
||||||
/* Otherwise.. */
|
/* Otherwise.. */
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -494,6 +487,23 @@ static void event_process(const XEvent *ec, gpointer data)
|
||||||
/* crossing events for menu */
|
/* crossing events for menu */
|
||||||
event_handle_menu(e);
|
event_handle_menu(e);
|
||||||
} else if (e->type == FocusIn) {
|
} else if (e->type == FocusIn) {
|
||||||
|
if (client &&
|
||||||
|
e->xfocus.detail == NotifyInferior)
|
||||||
|
{
|
||||||
|
ob_debug_type(OB_DEBUG_FOCUS,
|
||||||
|
"Focus went to the frame window");
|
||||||
|
|
||||||
|
focus_left_screen = FALSE;
|
||||||
|
|
||||||
|
focus_fallback(FALSE, FALSE);
|
||||||
|
|
||||||
|
/* We don't get a FocusOut for this case, because it's just moving
|
||||||
|
from our Inferior up to us. This happens when iconifying a
|
||||||
|
window with RevertToParent focus */
|
||||||
|
frame_adjust_focus(client->frame, FALSE);
|
||||||
|
/* focus_set_client(NULL) has already been called */
|
||||||
|
client_calc_layer(client);
|
||||||
|
}
|
||||||
if (e->xfocus.detail == NotifyPointerRoot ||
|
if (e->xfocus.detail == NotifyPointerRoot ||
|
||||||
e->xfocus.detail == NotifyDetailNone ||
|
e->xfocus.detail == NotifyDetailNone ||
|
||||||
e->xfocus.detail == NotifyInferior ||
|
e->xfocus.detail == NotifyInferior ||
|
||||||
|
@ -501,9 +511,8 @@ static void event_process(const XEvent *ec, gpointer data)
|
||||||
{
|
{
|
||||||
XEvent ce;
|
XEvent ce;
|
||||||
|
|
||||||
ob_debug_type(OB_DEBUG_FOCUS, "Focus went to root, "
|
ob_debug_type(OB_DEBUG_FOCUS,
|
||||||
"pointer root/none or "
|
"Focus went to root or pointer root/none\n");
|
||||||
"the frame window\n");
|
|
||||||
|
|
||||||
if (e->xfocus.detail == NotifyInferior ||
|
if (e->xfocus.detail == NotifyInferior ||
|
||||||
e->xfocus.detail == NotifyNonlinear)
|
e->xfocus.detail == NotifyNonlinear)
|
||||||
|
@ -548,7 +557,9 @@ static void event_process(const XEvent *ec, gpointer data)
|
||||||
|
|
||||||
/* If you send focus to a window and then it disappears, you can
|
/* If you send focus to a window and then it disappears, you can
|
||||||
get the FocusIn for it, after it is unmanaged.
|
get the FocusIn for it, after it is unmanaged.
|
||||||
Just wait for the next FocusOut/FocusIn pair. */
|
Just wait for the next FocusOut/FocusIn pair, but make note that
|
||||||
|
the window that was focused no longer is. */
|
||||||
|
focus_set_client(NULL);
|
||||||
}
|
}
|
||||||
else if (client != focus_client) {
|
else if (client != focus_client) {
|
||||||
focus_left_screen = FALSE;
|
focus_left_screen = FALSE;
|
||||||
|
|
Loading…
Reference in a new issue