#include "openbox.h"
#include "prop.h"
+#include "startup.h"
#include "config.h"
#include "screen.h"
#include "client.h"
screen_num_desktops = 0;
screen_set_num_desktops(config_desktops_num);
- screen_desktop = 0;
- screen_set_desktop(0);
+ if (startup_desktop >= screen_num_desktops)
+ startup_desktop = 0;
+ screen_desktop = startup_desktop;
+ screen_set_desktop(startup_desktop);
/* don't start in showing-desktop mode */
screen_showing_desktop = FALSE;
/* 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);
}
}
+ 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);