gboolean client_focus(ObClient *self)
{
+ client_bring_modal_windows(self);
+
/* choose the correct target */
self = client_focus_target(self);
client_hilite(self, TRUE);
}
-static void client_bring_helper_windows_recursive(ObClient *self,
- guint desktop)
+static void client_bring_windows_recursive(ObClient *self,
+ guint desktop,
+ gboolean helpers,
+ gboolean modals)
{
GSList *it;
for (it = self->transients; it; it = g_slist_next(it))
- client_bring_helper_windows_recursive(it->data, desktop);
+ client_bring_windows_recursive(it->data, desktop, helpers, modals);
- if (client_helper(self) &&
+ if (((helpers && client_helper(self)) ||
+ (modals && self->modal))&&
self->desktop != desktop && self->desktop != DESKTOP_ALL)
{
client_set_desktop(self, desktop, FALSE);
void client_bring_helper_windows(ObClient *self)
{
- client_bring_helper_windows_recursive(self, self->desktop);
+ client_bring_windows_recursive(self, self->desktop, TRUE, FALSE);
+}
+
+void client_bring_modal_windows(ObClient *self)
+{
+ client_bring_windows_recursive(self, self->desktop, FALSE, TRUE);
}
gboolean client_focused(ObClient *self)
stuff windows. */
void client_bring_helper_windows(ObClient *self);
+/*! Bring all of its modal windows to its desktop. */
+void client_bring_modal_windows(ObClient *self);
+
/*! Calculates the stacking layer for the client window */
void client_calc_layer(ObClient *self);
!ft->skip_taskbar);
/* it's not going to just send fous off somewhere else (modal window) */
- ok = ok && ft == client_focus_target(ft);
+ {
+ ObClient *cft = client_focus_target(ft);
+ ok = ok && (ft == cft || (cft->desktop != DESKTOP_ALL &&
+ cft->desktop != ft->desktop));
+ }
return ok;
}