X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=bb98e084cadd9017c55205fe81fa6792d0a19671;hb=965ed8907a5dd81d5ffbc93b67a672fa78833854;hp=5074f18606c39e5684d6139250f6a09155cf07de;hpb=501943b53d68821a752ceda3fbd9b64bbcae4a4c;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 5074f186..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); + } } } } @@ -949,6 +957,8 @@ void screen_show_desktop_popup(guint d, gboolean perm) config_desktop_popup_time * 1000, hide_desktop_popup_func, desktop_popup, g_direct_equal, NULL); + if (perm) + desktop_popup_perm = TRUE; g_free(a); }