void action_iconify(union ActionData *data)
{
client_action_start(data);
- client_iconify(data->client.any.c, TRUE, TRUE);
+ client_iconify(data->client.any.c, TRUE, TRUE, FALSE);
client_action_end(data);
}
void action_toggle_show_desktop(union ActionData *data)
{
- screen_show_desktop(!screen_showing_desktop, TRUE);
+ screen_show_desktop(!screen_showing_desktop, NULL);
}
void action_show_desktop(union ActionData *data)
{
- screen_show_desktop(TRUE, TRUE);
+ screen_show_desktop(TRUE, NULL);
}
void action_unshow_desktop(union ActionData *data)
{
- screen_show_desktop(FALSE, TRUE);
+ screen_show_desktop(FALSE, NULL);
}
void action_break_chroot(union ActionData *data)
else self->shaded = FALSE;
}
if (!(self->functions & OB_CLIENT_FUNC_ICONIFY) && self->iconic) {
- if (self->frame) client_iconify(self, FALSE, TRUE);
+ if (self->frame) client_iconify(self, FALSE, TRUE, FALSE);
else self->iconic = FALSE;
}
if (!(self->functions & OB_CLIENT_FUNC_FULLSCREEN) && self->fullscreen) {
if (self->iconic) {
self->iconic = FALSE;
- client_iconify(self, TRUE, FALSE);
+ client_iconify(self, TRUE, FALSE, TRUE);
}
if (self->fullscreen) {
self->fullscreen = FALSE;
}
static void client_iconify_recursive(ObClient *self,
- gboolean iconic, gboolean curdesk)
+ gboolean iconic, gboolean curdesk,
+ gboolean hide_animation)
{
GSList *it;
gboolean changed = FALSE;
if (changed) {
client_change_state(self);
- if (ob_state() != OB_STATE_STARTING && config_animate_iconify)
+ if (config_animate_iconify && !hide_animation)
frame_begin_iconify_animation(self->frame, iconic);
/* do this after starting the animation so it doesn't flash */
client_showhide(self);
for (it = self->transients; it; it = g_slist_next(it))
if (it->data != self)
if (client_is_direct_child(self, it->data) || !iconic)
- client_iconify_recursive(it->data, iconic, curdesk);
+ client_iconify_recursive(it->data, iconic, curdesk,
+ hide_animation);
}
-void client_iconify(ObClient *self, gboolean iconic, gboolean curdesk)
+void client_iconify(ObClient *self, gboolean iconic, gboolean curdesk,
+ gboolean hide_animation)
{
if (self->functions & OB_CLIENT_FUNC_ICONIFY || !iconic) {
/* move up the transient chain as far as possible first */
self = client_search_top_normal_parent(self);
- client_iconify_recursive(self, iconic, curdesk);
+ client_iconify_recursive(self, iconic, curdesk, hide_animation);
}
}
switch (state) {
case IconicState:
- client_iconify(self, TRUE, TRUE);
+ client_iconify(self, TRUE, TRUE, FALSE);
break;
case NormalState:
- client_iconify(self, FALSE, TRUE);
+ client_iconify(self, FALSE, TRUE, FALSE);
break;
}
}
stacking_raise(CLIENT_AS_WINDOW(self));
}
if (iconic != self->iconic)
- client_iconify(self, iconic, FALSE);
+ client_iconify(self, iconic, FALSE, FALSE);
if (demands_attention != self->demands_attention)
client_hilite(self, demands_attention);
event_halt_focus_delay();
if (client_normal(self) && screen_showing_desktop)
- screen_show_desktop(FALSE, FALSE);
+ screen_show_desktop(FALSE, self);
if (self->iconic)
- client_iconify(self, FALSE, here);
+ client_iconify(self, FALSE, here, FALSE);
if (self->desktop != DESKTOP_ALL &&
self->desktop != screen_desktop)
{
screen_num_desktops);
}
-void screen_show_desktop(gboolean show, gboolean restore_focus)
+void screen_show_desktop(gboolean show, ObClient *show_only)
{
GList *it;
screen_showing_desktop = show;
if (show) {
- /* bottom to top */
+ /* hide windows bottom to top */
for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *client = it->data;
client_showhide(client);
}
}
- } else {
- /* top to bottom */
+ }
+ else {
+ /* restore windows top to bottom */
for (it = stacking_list; it; it = g_list_next(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *client = it->data;
- client_showhide(client);
+ if (client_should_show(client)) {
+ if (!show_only || client == show_only)
+ client_show(client);
+ else
+ client_iconify(client, TRUE, FALSE, TRUE);
+ }
}
}
}
client_focus(it->data))
break;
}
- } else if (restore_focus) {
+ }
+ else if (!show_only) {
ObClient *c;
/* use NULL for the "old" argument because the desktop was focused
void screen_desktop_popup(guint d, gboolean show);
/*! Shows and focuses the desktop and hides all the client windows, or
- returns to the normal state, showing client windows. */
-void screen_show_desktop(gboolean show, gboolean restore_focus);
+ returns to the normal state, showing client windows.
+ @param If show_only is non-NULL, then only that client is shown (assuming
+ show is FALSE (restoring from show-desktop mode), and the rest are
+ iconified.
+*/
+void screen_show_desktop(gboolean show, struct _ObClient *show_only);
/*! Updates the desktop layout from the root property if available */
void screen_update_layout();