X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=d88be432f1a26965b6103324db9d327ae79df0a1;hb=9cf5903e16c68ce1877d8d04ca6ee1c28e04a5ce;hp=03e4efea0f0c805f9520c7e8b506a87601311f42;hpb=d6625739427798a7d5a972b2173f400ea1fa7fc7;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 03e4efea..d88be432 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -33,6 +33,7 @@ #include "frame.h" #include "event.h" #include "focus.h" +#include "focus_cycle.h" #include "popup.h" #include "extensions.h" #include "render/render.h" @@ -717,15 +718,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; - client_hide(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 */ - 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); + } } } }