X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=73cc4f14b2bb253f852fc6726096a658fe2d420c;hb=1e957a168808f0357509300e879c0a7e97b49a24;hp=3819a3b1415cf70ff8becbaabe2ed45bb4eef9d2;hpb=f694c650c83a7c29324debf3ac35d5e0c3abd84e;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 3819a3b1..73cc4f14 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -494,7 +494,7 @@ void screen_set_desktop(guint num, gboolean dofocus) 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))) { + if (dofocus && (c = focus_fallback(TRUE))) { /* 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.. */ @@ -506,7 +506,6 @@ void screen_set_desktop(guint num, gboolean dofocus) server FocusIn event */ frame_adjust_focus(c->frame, TRUE); } - client_focus(c); } /* hide windows from bottom to top */ @@ -939,7 +938,7 @@ void screen_show_desktop(gboolean show, ObClient *show_only) } if (show) { - /* focus desktop */ + /* focus the desktop */ for (it = focus_order; it; it = g_list_next(it)) { ObClient *c = it->data; if (c->type == OB_CLIENT_TYPE_DESKTOP && @@ -951,10 +950,16 @@ void screen_show_desktop(gboolean show, ObClient *show_only) else if (!show_only) { ObClient *c; - /* use NULL for the "old" argument because the desktop was focused - and we don't want to fallback to the desktop by default */ - if ((c = focus_fallback_target(TRUE, NULL))) - client_focus(c); + if ((c = focus_fallback(TRUE))) { + /* 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) { + /* reduce flicker by hiliting now rather than waiting for the + server FocusIn event */ + frame_adjust_focus(c->frame, TRUE); + } + } } show = !!show; /* make it boolean */