]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
put the separator back in the spit up client list menu
[chaz/openbox] / openbox / screen.c
index c6a6b0e5aa7e339f326d54f985cfae0541e7b3a9..c0569c29406eadd79027b0d7631b8fa4346e4a62 100644 (file)
@@ -422,6 +422,7 @@ void screen_set_num_desktops(guint num)
 
 void screen_set_desktop(guint num)
 {
+    ObClient *c;
     GList *it;
     guint old;
      
@@ -459,18 +460,13 @@ void screen_set_desktop(guint num)
         }
     }
 
-    focus_hilite = focus_fallback_target(TRUE, focus_client);
-    if (focus_hilite) {
-        frame_adjust_focus(focus_hilite->frame, TRUE);
-
-        /*!
-          When this focus_client check is not used, you can end up with
-          races, as demonstrated with gnome-panel, sometimes the window
-          you click on another desktop ends up losing focus cuz of the
-          focus change here.
-        */
-        /*if (!focus_client)*/
-        client_focus(focus_hilite);
+    /* have to try focus here because when you leave an empty desktop
+       there is no focus out to watch for */
+    if ((c = focus_fallback_target(TRUE, focus_client))) {
+        /* reduce flicker by hiliting now rather than waiting for the server
+           FocusIn event */
+        frame_adjust_focus(c->frame, TRUE);
+        client_focus(c);
     }
 
     event_ignore_queued_enters();
@@ -895,21 +891,12 @@ void screen_show_desktop(gboolean show)
                 break;
         }
     } else {
+        ObClient *c;
+
         /* use NULL for the "old" argument because the desktop was focused
            and we don't want to fallback to the desktop by default */
-        focus_hilite = focus_fallback_target(TRUE, NULL);
-        if (focus_hilite) {
-            frame_adjust_focus(focus_hilite->frame, TRUE);
-
-            /*!
-              When this focus_client check is not used, you can end up with
-              races, as demonstrated with gnome-panel, sometimes the window
-              you click on another desktop ends up losing focus cuz of the
-              focus change here.
-            */
-            /*if (!focus_client)*/
-            client_focus(focus_hilite);
-        }
+        if ((c = focus_fallback_target(TRUE, NULL)))
+            client_focus(c);
     }
 
     show = !!show; /* make it boolean */
This page took 0.022841 seconds and 4 git commands to generate.