Unused variable guint old
[mikachu/openbox.git] / openbox / screen.c
index 5ae0790..1f95bc6 100644 (file)
@@ -513,7 +513,6 @@ void screen_resize(void)
 
 void screen_set_num_desktops(guint num)
 {
-    guint old;
     gulong *viewport;
     GList *it, *stacking_copy;
 
@@ -521,7 +520,6 @@ void screen_set_num_desktops(guint num)
 
     if (screen_num_desktops == num) return;
 
-    old = screen_num_desktops;
     screen_num_desktops = num;
     PROP_SET32(RootWindow(ob_display, ob_screen),
                net_number_of_desktops, cardinal, num);
@@ -713,8 +711,7 @@ void screen_set_desktop(guint num, gboolean dofocus)
     for (it = stacking_list; it; it = g_list_next(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            if (client_show(c))
-                focus_cycle_add(c);
+            client_show(c);
         }
     }
 
@@ -725,8 +722,6 @@ void screen_set_desktop(guint num, gboolean dofocus)
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
             if (client_hide(c)) {
-                focus_cycle_remove(c);
-
                 if (c == focus_client) {
                     /* c was focused and we didn't do fallback clearly so make
                        sure openbox doesnt still consider the window focused.
@@ -742,6 +737,8 @@ void screen_set_desktop(guint num, gboolean dofocus)
         }
     }
 
+    focus_cycle_addremove(NULL, TRUE);
+
     event_end_ignore_all_enters(ignore_start);
 
     if (event_curtime != CurrentTime)