X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Fopenbox;a=blobdiff_plain;f=openbox%2Fscreen.c;fp=openbox%2Fscreen.c;h=bb98e084cadd9017c55205fe81fa6792d0a19671;hp=aabed2149368fe0aee55b66b5ce124633077e14c;hb=965ed8907a5dd81d5ffbc93b67a672fa78833854;hpb=aeac6294a3c45c10d04f108a6fc767298132735c diff --git a/openbox/screen.c b/openbox/screen.c index aabed214..bb98e084 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -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); + } } } }