X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=87156eb6d370c4b552e1860d230c33aa2208e149;hb=ebabf3943c926547739254fb67f8024166ea000f;hp=54ae99fcceb074949c4a97850ae57fdfa7fff4fa;hpb=5945d2e9c851a03d58ab364fe93136cbe5079c2b;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 54ae99fc..87156eb6 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2812,7 +2812,7 @@ static void client_iconify_recursive(ObClient *self, if (curdesk && self->desktop != screen_desktop && self->desktop != DESKTOP_ALL) - client_set_desktop(self, screen_desktop, FALSE); + client_set_desktop(self, screen_desktop, FALSE, FALSE); /* this puts it after the current focused window */ focus_order_remove(self); @@ -2992,7 +2992,9 @@ void client_hilite(ObClient *self, gboolean hilite) } void client_set_desktop_recursive(ObClient *self, - guint target, gboolean donthide) + guint target, + gboolean donthide, + gboolean focus_nonintrusive) { guint old; GSList *it; @@ -3004,7 +3006,8 @@ void client_set_desktop_recursive(ObClient *self, g_assert(target < screen_num_desktops || target == DESKTOP_ALL); /* remove from the old desktop(s) */ - focus_order_remove(self); + if (!focus_nonintrusive) + focus_order_remove(self); old = self->desktop; self->desktop = target; @@ -3021,10 +3024,12 @@ void client_set_desktop_recursive(ObClient *self, screen_update_areas(); /* add to the new desktop(s) */ - if (config_focus_new) - focus_order_to_top(self); - else - focus_order_to_bottom(self); + if (!focus_nonintrusive) { + if (config_focus_new) + focus_order_to_top(self); + else + focus_order_to_bottom(self); + } /* call the notifies */ GSList *it; @@ -3038,13 +3043,15 @@ void client_set_desktop_recursive(ObClient *self, for (it = self->transients; it; it = g_slist_next(it)) if (it->data != self) if (client_is_direct_child(self, it->data)) - client_set_desktop_recursive(it->data, target, donthide); + client_set_desktop_recursive(it->data, target, + donthide, focus_nonintrusive); } -void client_set_desktop(ObClient *self, guint target, gboolean donthide) +void client_set_desktop(ObClient *self, guint target, + gboolean donthide, gboolean focus_nonintrusive) { self = client_search_top_normal_parent(self); - client_set_desktop_recursive(self, target, donthide); + client_set_desktop_recursive(self, target, donthide, focus_nonintrusive); } gboolean client_is_direct_child(ObClient *parent, ObClient *child) @@ -3378,7 +3385,7 @@ static void client_present(ObClient *self, gboolean here, gboolean raise) self->desktop != screen_desktop) { if (here) - client_set_desktop(self, screen_desktop, FALSE); + client_set_desktop(self, screen_desktop, FALSE, FALSE); else screen_set_desktop(self->desktop, FALSE); } else if (!self->frame->visible) @@ -3426,6 +3433,26 @@ void client_activate(ObClient *self, gboolean here, gboolean user) } } +static void client_bring_non_application_windows_recursive(ObClient *self, + guint desktop) +{ + GSList *it; + + for (it = self->transients; it; it = g_slist_next(it)) + client_bring_non_application_windows_recursive(it->data, desktop); + + if (client_normal(self) && !client_application(self) && + self->desktop != desktop && self->desktop != DESKTOP_ALL) + { + client_set_desktop(self, desktop, FALSE, TRUE); + } +} + +void client_bring_non_application_windows(ObClient *self) +{ + client_bring_non_application_windows_recursive(self, self->desktop); +} + void client_raise(ObClient *self) { action_run_string("Raise", self, CurrentTime);