]> Dogcows Code - chaz/openbox/commitdiff
only put a transient for the group onto some other desktop if its whole group is...
authorDana Jansens <danakj@orodu.net>
Thu, 24 May 2007 19:38:03 +0000 (19:38 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 24 May 2007 19:38:03 +0000 (19:38 +0000)
openbox/client.c

index d8eb207f486a592cb72978941a0dc8c4566af94b..bcd510051a5d069fbeac5c78645a28ecb9a68171 100644 (file)
@@ -1139,15 +1139,27 @@ static void client_get_desktop(ObClient *self)
                 self->desktop = self->transient_for->desktop;
                 trdesk = TRUE;
             } else {
+                /* if all the group is on one desktop, then open it on the
+                   same desktop */
                 GSList *it;
+                gboolean first = TRUE;
+                guint all = screen_num_desktops; /* not a valid value */
 
-                for (it = self->group->members; it; it = g_slist_next(it))
-                    if (it->data != self &&
-                        !((ObClient*)it->data)->transient_for) {
-                        self->desktop = ((ObClient*)it->data)->desktop;
-                        trdesk = TRUE;
-                        break;
+                for (it = self->group->members; it; it = g_slist_next(it)) {
+                    ObClient *c = it->data;
+                    if (c != self) {
+                        if (first) {
+                            all = c->desktop;
+                            first = FALSE;
+                        }
+                        else if (all != c->desktop)
+                            all = screen_num_desktops; /* make it invalid */
                     }
+                }
+                if (all != screen_num_desktops) {
+                    self->desktop = all;
+                    trdesk = TRUE;
+                }
             }
         }
         if (!trdesk) {
This page took 0.024626 seconds and 4 git commands to generate.