X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fscreen.c;h=656206bf712d94420821126f69a85564112ba1d4;hb=0f544808b8372a6c8a2cbfae214f2803dd3c6170;hp=38ad8978d7cf32a56fc3e1637a46c8d4c210dd8e;hpb=7416313cad8d0dc51d5a5ea31b20296755f3049d;p=chaz%2Fopenbox diff --git a/openbox/screen.c b/openbox/screen.c index 38ad8978..656206bf 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -366,29 +366,29 @@ void screen_set_num_desktops(guint num) /* may be some unnamed desktops that we need to fill in with names */ screen_update_desktop_names(); - /* update the focus lists */ - /* free our lists for the desktops which have disappeared */ - for (i = num; i < old; ++i) - g_list_free(focus_order[i]); - /* realloc the array */ - focus_order = g_renew(GList*, focus_order, num); - /* set the new lists to be empty */ - for (i = old; i < num; ++i) - focus_order[i] = NULL; - /* move windows on desktops that will no longer exist! */ for (it = client_list; it != NULL; it = it->next) { ObClient *c = it->data; if (c->desktop >= num && c->desktop != DESKTOP_ALL) client_set_desktop(c, num - 1, FALSE); } - + /* change our struts/area to match (after moving windows) */ screen_update_areas(); /* change our desktop if we're on one that no longer exists! */ if (screen_desktop >= screen_num_desktops) screen_set_desktop(num - 1); + + /* update the focus lists */ + /* free our lists for the desktops which have disappeared */ + for (i = num; i < old; ++i) + g_list_free(focus_order[i]); + /* realloc the array */ + focus_order = g_renew(GList*, focus_order, num); + /* set the new lists to be empty */ + for (i = old; i < num; ++i) + focus_order[i] = NULL; } void screen_set_desktop(guint num) @@ -430,6 +430,7 @@ void screen_set_desktop(guint num) } } + XSync(ob_display, FALSE); /* focus the last focused window on the desktop, and ignore enter events from the switch so it doesnt mess with the focus */ while (XCheckTypedEvent(ob_display, EnterNotify, &e));