]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
make helper windows share desktops with all their application top level windows
[chaz/openbox] / openbox / client.c
index 54ae99fcceb074949c4a97850ae57fdfa7fff4fa..87156eb6d370c4b552e1860d230c33aa2208e149 100644 (file)
@@ -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);
This page took 0.022074 seconds and 4 git commands to generate.