more cleanup

This commit is contained in:
Dana Jansens 2007-06-07 03:25:15 +00:00
parent 571b09f999
commit 7a33207a50

View file

@ -1102,15 +1102,12 @@ static void client_get_desktop(ObClient *self)
self->desktop = d; self->desktop = d;
ob_debug("client requested desktop 0x%x\n", self->desktop); ob_debug("client requested desktop 0x%x\n", self->desktop);
} else { } else {
gboolean trdesk = FALSE;
if (self->transient_for) {
/* if they are all on one desktop, then open it on the
same desktop */
GSList *it; GSList *it;
gboolean first = TRUE; gboolean first = TRUE;
guint all = screen_num_desktops; /* not a valid value */ guint all = screen_num_desktops; /* not a valid value */
/* if they are all on one desktop, then open it on the
same desktop */
for (it = self->parents; it; it = g_slist_next(it)) { for (it = self->parents; it; it = g_slist_next(it)) {
ObClient *c = it->data; ObClient *c = it->data;
@ -1125,20 +1122,16 @@ static void client_get_desktop(ObClient *self)
} }
if (all != screen_num_desktops) { if (all != screen_num_desktops) {
self->desktop = all; self->desktop = all;
trdesk = TRUE;
} }
}
if (!trdesk) {
/* try get from the startup-notification protocol */ /* try get from the startup-notification protocol */
if (sn_get_desktop(self->startup_id, &self->desktop)) { else if (sn_get_desktop(self->startup_id, &self->desktop)) {
if (self->desktop >= screen_num_desktops && if (self->desktop >= screen_num_desktops &&
self->desktop != DESKTOP_ALL) self->desktop != DESKTOP_ALL)
self->desktop = screen_num_desktops - 1; self->desktop = screen_num_desktops - 1;
} else
/* defaults to the current desktop */
self->desktop = screen_desktop;
} }
/* defaults to the current desktop */
else
self->desktop = screen_desktop;
} }
} }