- /* force the callbacks to fire */
- if (focus_client == NULL)
- focus_set_client(NULL);
+ /* show windows from top to bottom */
+ for (it = stacking_list; it != NULL; it = it->next) {
+ Client *c = it->data;
+ if (!c->frame->visible && client_should_show(c))
+ engine_frame_show(c->frame);
+ }
+
+ /* hide windows from bottom to top */
+ for (it = g_list_last(stacking_list); it != NULL; it = it->prev) {
+ Client *c = it->data;
+ if (c->frame->visible && !client_should_show(c))
+ engine_frame_hide(c->frame);
+ }
+
+ /* focus the last focused window on the desktop, and ignore enter events
+ from the switch so it doesnt mess with the focus */
+ XSync(ob_display, FALSE);
+ while (XCheckTypedEvent(ob_display, EnterNotify, &e));
+ focus_fallback(TRUE);
+
+ dispatch_ob(Event_Ob_Desktop, num, old);