summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2011-10-05 13:25:46 -0400
committerDana Jansens <danakj@orodu.net>2011-10-05 13:32:09 -0400
commitdc6d1d75b40e3d138786d7a2e969d7225f11fb7b (patch)
tree4e325a36f49ffb1c6e6ac09d1784fe692bd5e1c8
parenteea1a9fef91686a511ae0a8590dbb6df02c26470 (diff)
Consistency with helper/modal windows and multiple desktops.
When focusing a window, bring its helper windows. This happened before when switching its desktop, but if you have 2 windows on different desktops and switch between them, the helpers should come to both when they are being used. When a new helper/modal window maps on a different desktop and you are using the application, then the helper/modal window is moved to the current desktop to be with the application you are using.
-rw-r--r--openbox/client.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/openbox/client.c b/openbox/client.c
index e3d3013e..e4d85344 100644
--- a/openbox/client.c
+++ b/openbox/client.c
@@ -256,6 +256,15 @@ void client_manage(Window window, ObPrompt *prompt)
/* the session should get the last say though */
client_restore_session_state(self);
+ /* don't put helper/modal windows on a different desktop if they are
+ related to the focused window. */
+ if (!screen_compare_desktops(self->desktop, screen_desktop) &&
+ focus_client && client_search_transient(focus_client, self) &&
+ (client_helper(self) || self->modal))
+ {
+ self->desktop = screen_desktop;
+ }
+
/* tell startup notification that this app started */
launch_time = sn_app_started(self->startup_id, self->class, self->name);
@@ -3928,6 +3937,9 @@ gboolean client_focus(ObClient *self)
return FALSE;
}
+ /* if we have helper windows they should be there with the window */
+ client_bring_helper_windows(self);
+
ob_debug_type(OB_DEBUG_FOCUS,
"Focusing client \"%s\" (0x%x) at time %u",
self->title, self->window, event_time());
@@ -4020,7 +4032,7 @@ static void client_bring_windows_recursive(ObClient *self,
if (((helpers && client_helper(self)) ||
(modals && self->modal)) &&
- ((self->desktop != desktop && self->desktop != DESKTOP_ALL) ||
+ (!screen_compare_desktops(self->desktop, desktop) ||
(iconic && self->iconic)))
{
if (iconic && self->iconic)