don't steal focus from windows you are typing in, even if the new window is a relative
This commit is contained in:
parent
e4691468cd
commit
6005365133
1 changed files with 15 additions and 7 deletions
|
@ -494,6 +494,12 @@ void client_manage(Window window, ObPrompt *prompt)
|
||||||
activate ? "yes" : "no");
|
activate ? "yes" : "no");
|
||||||
if (activate) {
|
if (activate) {
|
||||||
gboolean raise = FALSE;
|
gboolean raise = FALSE;
|
||||||
|
gboolean relative_focused = FALSE;
|
||||||
|
|
||||||
|
relative_focused = (focus_client != NULL &&
|
||||||
|
client_search_focus_tree_full(self) != NULL &&
|
||||||
|
client_search_focus_group_full(self) != NULL);
|
||||||
|
|
||||||
|
|
||||||
/* This is focus stealing prevention */
|
/* This is focus stealing prevention */
|
||||||
ob_debug_type(OB_DEBUG_FOCUS,
|
ob_debug_type(OB_DEBUG_FOCUS,
|
||||||
|
@ -524,10 +530,8 @@ void client_manage(Window window, ObPrompt *prompt)
|
||||||
"Not focusing the window because its on another "
|
"Not focusing the window because its on another "
|
||||||
"desktop\n");
|
"desktop\n");
|
||||||
}
|
}
|
||||||
/* If something is focused, and it's not our relative... */
|
/* If something is focused... */
|
||||||
else if (focus_client && client_search_focus_tree_full(self) == NULL &&
|
else if (focus_client) {
|
||||||
client_search_focus_group_full(self) == NULL)
|
|
||||||
{
|
|
||||||
/* If the user is working in another window right now, then don't
|
/* If the user is working in another window right now, then don't
|
||||||
steal focus */
|
steal focus */
|
||||||
if (event_last_user_time && launch_time &&
|
if (event_last_user_time && launch_time &&
|
||||||
|
@ -541,8 +545,9 @@ void client_manage(Window window, ObPrompt *prompt)
|
||||||
"Not focusing the window because the user is "
|
"Not focusing the window because the user is "
|
||||||
"working in another window\n");
|
"working in another window\n");
|
||||||
}
|
}
|
||||||
/* If it's a transient (and its parents aren't focused) */
|
/* If the new window is a transient (and its relatives aren't
|
||||||
else if (client_has_parent(self)) {
|
focused) */
|
||||||
|
else if (client_has_parent(self) && !relative_focused) {
|
||||||
activate = FALSE;
|
activate = FALSE;
|
||||||
ob_debug_type(OB_DEBUG_FOCUS,
|
ob_debug_type(OB_DEBUG_FOCUS,
|
||||||
"Not focusing the window because it is a "
|
"Not focusing the window because it is a "
|
||||||
|
@ -568,8 +573,11 @@ void client_manage(Window window, ObPrompt *prompt)
|
||||||
"Not focusing the window because another window "
|
"Not focusing the window because another window "
|
||||||
"would get the focus anyway\n");
|
"would get the focus anyway\n");
|
||||||
}
|
}
|
||||||
|
/* Don't move focus if the window is not visible on the current
|
||||||
|
desktop and none of its relatives are focused */
|
||||||
else if (!(self->desktop == screen_desktop ||
|
else if (!(self->desktop == screen_desktop ||
|
||||||
self->desktop == DESKTOP_ALL))
|
self->desktop == DESKTOP_ALL) &&
|
||||||
|
!relative_focused)
|
||||||
{
|
{
|
||||||
activate = FALSE;
|
activate = FALSE;
|
||||||
raise = TRUE;
|
raise = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue