X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fscreen.c;h=c941e8daf3270dcd1166dd9ce2c16d7876bf3dfc;hb=c2b3a49e692b723bd277ef4360f89b9aaae4afd6;hp=118798e8e8b02f00a8a3b61c30b37a0b6e84948a;hpb=12d4c8666c9475f254783fd33d1eb2b47f32e030;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 118798e8..c941e8da 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -302,7 +302,6 @@ void screen_set_desktop(guint num) /* focus the last focused window on the desktop, and ignore enter events from the switch so it doesnt mess with the focus */ - XSync(ob_display, FALSE); while (XCheckTypedEvent(ob_display, EnterNotify, &e)); focus_fallback(Fallback_Desktop); @@ -424,6 +423,16 @@ void screen_show_desktop(gboolean show) } } + if (show) { + /* focus desktop */ + for (it = focus_order[screen_desktop]; it; it = it->next) + if (((Client*)it->data)->type == Type_Desktop && + client_focus(it->data)) + break; + } else { + focus_fallback(Fallback_NoFocus); + } + show = !!show; /* make it boolean */ PROP_SET32(ob_root, net_showing_desktop, cardinal, show);