summaryrefslogtreecommitdiff
path: root/openbox/client.c
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2010-10-16 17:36:46 -0400
committerDana Jansens <danakj@orodu.net>2011-01-24 14:19:23 -0500
commit29d595b1783240f2ff63fb8b3bbc6054d909d858 (patch)
treec348a2ba8eb634f711150b79685a3959c056f936 /openbox/client.c
parent385967b55290105f074080890d55b50d9622b89d (diff)
when focus=yes in the per-app settings, then the focus request for the new window is from a user. also if allow_other_desktops is false, then always disallow other desktops (Fixes bug #4752)
Diffstat (limited to 'openbox/client.c')
-rw-r--r--openbox/client.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/openbox/client.c b/openbox/client.c
index 35b146eb..cccc59db 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -303,9 +303,10 @@ void client_manage(Window window, ObPrompt *prompt)
ob_debug("Going to try activate new window? %s",
try_activate ? "yes" : "no");
if (try_activate)
- do_activate = client_can_steal_focus(self, settings->focus,
- !!launch_time,
- event_time(), launch_time);
+ do_activate = client_can_steal_focus(
+ self, settings->focus == 1,
+ (!!launch_time || settings->focus == 1),
+ event_time(), launch_time);
else
do_activate = FALSE;
@@ -712,9 +713,11 @@ static gboolean client_can_steal_focus(ObClient *self,
/* This is focus stealing prevention */
ob_debug("Want to focus window 0x%x at time %u "
"launched at %u (last user interaction time %u) "
- "request from %s",
+ "request from %s, allow other desktop: %s",
self->window, steal_time, launch_time,
- event_last_user_time, (request_from_user ? "user" : "other"));
+ event_last_user_time,
+ (request_from_user ? "user" : "other"),
+ (allow_other_desktop ? "yes" : "no"));
/*
if no launch time is provided for an application, make one up.
@@ -826,7 +829,8 @@ static gboolean client_can_steal_focus(ObClient *self,
}
/* Don't move focus if the window is not visible on the current
desktop and none of its relatives are focused */
- else if (!screen_compare_desktops(self->desktop, screen_desktop) &&
+ else if (!allow_other_desktop &&
+ !screen_compare_desktops(self->desktop, screen_desktop) &&
!relative_focused)
{
steal = FALSE;