diff options
author | markt <markt> | 2007-01-14 19:05:34 (GMT) |
---|---|---|
committer | markt <markt> | 2007-01-14 19:05:34 (GMT) |
commit | e622927efb135a0fd69d5d2227ae6f532f4ff0c7 (patch) | |
tree | d62bebb320522e0bc7860e923127960f2437625a /src | |
parent | 6512024f08e71c10b41040318e7dc0f9a5810224 (diff) | |
download | fluxbox-e622927efb135a0fd69d5d2227ae6f532f4ff0c7.zip fluxbox-e622927efb135a0fd69d5d2227ae6f532f4ff0c7.tar.bz2 |
stay on same workspace after restart
Diffstat (limited to 'src')
-rw-r--r-- | src/Screen.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index a82307d..252df9c 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -460,8 +460,21 @@ BScreen::BScreen(FbTk::ResourceManager &rm, | |||
460 | setupConfigmenu(*m_configmenu.get()); | 460 | setupConfigmenu(*m_configmenu.get()); |
461 | m_configmenu->setInternalMenu(); | 461 | m_configmenu->setInternalMenu(); |
462 | 462 | ||
463 | // start with workspace 0 | 463 | // check which desktop we should start on |
464 | changeWorkspaceID(0); | 464 | unsigned int first_desktop = 0; |
465 | if (m_restart) { | ||
466 | Atom net_desktop = XInternAtom(disp, "_NET_CURRENT_DESKTOP", False); | ||
467 | // other arguments are already defined above | ||
468 | if (XGetWindowProperty(disp, m_root_window.window(), net_desktop, 0l, | ||
469 | 1l, False, XA_CARDINAL, &xa_ret_type, &ret_format, &ret_nitems, | ||
470 | &ret_bytes_after, &ret_prop) == Success) { | ||
471 | if (ret_prop && (unsigned int) *ret_prop < (unsigned) nr_ws) | ||
472 | first_desktop = (unsigned int) *ret_prop; | ||
473 | XFree(ret_prop); | ||
474 | } | ||
475 | } | ||
476 | |||
477 | changeWorkspaceID(first_desktop); | ||
465 | updateNetizenWorkspaceCount(); | 478 | updateNetizenWorkspaceCount(); |
466 | 479 | ||
467 | // we need to load win frame theme before we create any fluxbox window | 480 | // we need to load win frame theme before we create any fluxbox window |