]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
save the focus_client when falling back, so we don't actually refocus it when we...
[chaz/openbox] / openbox / screen.c
index 053757f7dde50258620ffec400dd0a14237549a8..70de299d35acbc0bc879e91b2a7ada6292534644 100644 (file)
@@ -449,8 +449,7 @@ void screen_set_desktop(guint num)
     for (it = stacking_list; it; it = g_list_next(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            if (client_should_show(c))
-                frame_show(c->frame);
+            client_showhide(c);
         }
     }
 
@@ -458,14 +457,13 @@ void screen_set_desktop(guint num)
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            if (c->frame->visible && !client_should_show(c))
-                frame_hide(c->frame);
+            client_showhide(c);
         }
     }
 
     event_ignore_queued_enters();
 
-    focus_hilite = focus_fallback_target(OB_FOCUS_FALLBACK_NOFOCUS, NULL);
+    focus_hilite = focus_fallback_target(TRUE, focus_client);
     if (focus_hilite) {
         frame_adjust_focus(focus_hilite->frame, TRUE);
 
@@ -875,8 +873,7 @@ void screen_show_desktop(gboolean show)
         for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
             if (WINDOW_IS_CLIENT(it->data)) {
                 ObClient *client = it->data;
-                if (client->frame->visible && !client_should_show(client))
-                    frame_hide(client->frame);
+                client_showhide(client);
             }
         }
     } else {
@@ -884,8 +881,7 @@ void screen_show_desktop(gboolean show)
         for (it = stacking_list; it; it = g_list_next(it)) {
             if (WINDOW_IS_CLIENT(it->data)) {
                 ObClient *client = it->data;
-                if (!client->frame->visible && client_should_show(client))
-                    frame_show(client->frame);
+                client_showhide(client);
             }
         }
     }
@@ -894,10 +890,10 @@ void screen_show_desktop(gboolean show)
         /* focus desktop */
         for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
             if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP &&
-                client_focus(it->data))
+                client_validate(it->data) && client_focus(it->data))
                 break;
     } else {
-        focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
+        focus_fallback(TRUE);
     }
 
     show = !!show; /* make it boolean */
This page took 0.022278 seconds and 4 git commands to generate.