diff options
| author | Dana Jansens <danakj@orodu.net> | 2008-03-02 15:03:10 -0500 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2008-03-02 15:03:10 -0500 |
| commit | c70379fa8f771e499a4d47e84af06d71838b780d (patch) | |
| tree | 0f244d32b2069c0b8d68895e34532bfaf98d9392 /openbox/client.c | |
| parent | 9676757a08b3e2e508c47f7795326bda8e54dc53 (diff) | |
| parent | b8960827b76ad499170e8b5b9ae8bf202188f0b0 (diff) | |
Merge branch 'backport' into work
Diffstat (limited to 'openbox/client.c')
| -rw-r--r-- | openbox/client.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/openbox/client.c b/openbox/client.c index c0864bc4..b57d6169 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -414,6 +414,12 @@ void client_manage(Window window, ObPrompt *prompt) activate ? "yes" : "no"); if (activate) { 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 */ ob_debug_type(OB_DEBUG_FOCUS, @@ -444,10 +450,8 @@ void client_manage(Window window, ObPrompt *prompt) "Not focusing the window because its on another " "desktop"); } - /* If something is focused, and it's not our relative... */ - else if (focus_client && client_search_focus_tree_full(self) == NULL && - client_search_focus_group_full(self) == NULL) - { + /* If something is focused... */ + else if (focus_client) { /* If the user is working in another window right now, then don't steal focus */ if (event_last_user_time && launch_time && @@ -461,8 +465,9 @@ void client_manage(Window window, ObPrompt *prompt) "Not focusing the window because the user is " "working in another window"); } - /* If it's a transient (and its parents aren't focused) */ - else if (client_has_parent(self)) { + /* If the new window is a transient (and its relatives aren't + focused) */ + else if (client_has_parent(self) && !relative_focused) { activate = FALSE; ob_debug_type(OB_DEBUG_FOCUS, "Not focusing the window because it is a " @@ -488,8 +493,11 @@ void client_manage(Window window, ObPrompt *prompt) "Not focusing the window because another window " "would get the focus anyway"); } + /* 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 || - self->desktop == DESKTOP_ALL)) + self->desktop == DESKTOP_ALL) && + !relative_focused) { activate = FALSE; raise = TRUE; |
