X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=d48d0dda2284fc6b1ec80cd1bfcf7a8de93ff3cb;hb=7869b81d4601b4ee04296d8139f2665c33b3a3d2;hp=5fc2bb9221390ecac63b6710d64a54dbfd578a67;hpb=37e2be2a57a218bd671e2e4b056643fbb248ad02;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 5fc2bb92..d48d0dda 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -485,6 +485,27 @@ void screen_set_desktop(guint num, gboolean dofocus) } } + /* have to try focus here because when you leave an empty desktop + there is no focus out to watch for + + do this before hiding the windows so if helper windows are coming + with us, they don't get hidden + */ + if (dofocus && (c = focus_fallback_target(TRUE, focus_client))) { + /* only do the flicker reducing stuff ahead of time if we are going + to call xsetinputfocus on the window ourselves. otherwise there is + no guarantee the window will actually take focus.. */ + if (c->can_focus) { + /* do this here so that if you switch desktops to a window with + helper windows then the helper windows won't flash */ + client_bring_helper_windows(c); + /* reduce flicker by hiliting now rather than waiting for the + server FocusIn event */ + frame_adjust_focus(c->frame, TRUE); + } + client_focus(c); + } + /* hide windows from bottom to top */ for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) { if (WINDOW_IS_CLIENT(it->data)) { @@ -493,15 +514,6 @@ void screen_set_desktop(guint num, gboolean dofocus) } } - /* have to try focus here because when you leave an empty desktop - there is no focus out to watch for */ - if (dofocus && (c = focus_fallback_target(TRUE, focus_client))) { - /* reduce flicker by hiliting now rather than waiting for the server - FocusIn event */ - frame_adjust_focus(c->frame, TRUE); - client_focus(c); - } - event_ignore_queued_enters(); if (event_curtime != CurrentTime)