]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
Merge branch 'backport' into work
[chaz/openbox] / openbox / screen.c
index aabed2149368fe0aee55b66b5ce124633077e14c..bb98e084cadd9017c55205fe81fa6792d0a19671 100644 (file)
@@ -30,6 +30,7 @@
 #include "frame.h"
 #include "event.h"
 #include "focus.h"
+#include "focus_cycle.h"
 #include "popup.h"
 #include "render/render.h"
 #include "gettext.h"
@@ -703,14 +704,21 @@ void screen_set_desktop(guint num, gboolean dofocus)
     for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
         if (WINDOW_IS_CLIENT(it->data)) {
             ObClient *c = it->data;
-            if (client_hide(c) && c == focus_client) {
-                /* c was focused and we didn't do fallback clearly so make sure
-                   openbox doesnt still consider the window focused.
-                   this happens when using NextWindow with allDesktops, since
-                   it doesnt want to move focus on desktop change, but the
-                   focus is not going to stay with the current window, which
-                   has now disappeared */
-                focus_set_client(NULL);
+            if (client_hide(c)) {
+                /* in the middle of cycling..? kill it. */
+                focus_cycle_stop(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.
+                       this happens when using NextWindow with allDesktops,
+                       since it doesnt want to move focus on desktop change,
+                       but the focus is not going to stay with the current
+                       window, which has now disappeared.
+                       only do this if the client was actually hidden,
+                       otherwise it can keep focus. */
+                    focus_set_client(NULL);
+                }
             }
         }
     }
This page took 0.026105 seconds and 4 git commands to generate.