all repos — fluxbox @ 2d14b33ef4de3e8cd95474bc103fe3dba5cbb33b

custom fork of the fluxbox windowmanager

distinguish between startup and restart
markt markt
commit

2d14b33ef4de3e8cd95474bc103fe3dba5cbb33b

parent

7b49c4a00bc8d0b9685868e5ad4699b8c5530ab9

4 files changed, 29 insertions(+), 7 deletions(-)

jump to
M ChangeLogChangeLog

@@ -1,5 +1,8 @@

(Format: Year/Month/Day) Changes for 1.0rc3: +*06/08/06: + * Distinguish between startup and restart (Mark) + Screen.cc/hh Remember.cc *06/08/05: * Don't call placement strategy on maximized or fullscreen windows (Mark) Window.cc
M src/Remember.ccsrc/Remember.cc

@@ -963,7 +963,7 @@ if (app == 0)

return; // nothing to do // first, set the options that aren't preserved as window properties on - // restart, then return if fluxbox is starting up -- we want restart to + // restart, then return if fluxbox is restarting -- we want restart to // disturb the current window state as little as possible Window leftwin = winclient.getGroupLeftWindow(); if (app->is_grouped && app->group == 0 && leftwin == None)

@@ -978,11 +978,11 @@ win.moveToLayer(app->layer);

if (app->decostate_remember) win.setDecorationMask(app->decostate); - // now check if fluxbox is starting up - if (Fluxbox::instance()->isStartup()) - return; - BScreen &screen = winclient.screen(); + + // now check if fluxbox is restarting + if (screen.isRestart()) + return; if (app->workspace_remember) { // we use setWorkspace and not reassoc because we're still initialising

@@ -1050,7 +1050,7 @@ }

void Remember::setupClient(WinClient &winclient) { - if (Fluxbox::instance()->isStartup()) + if (winclient.screen().isRestart()) return; // don't mess up windows on restart Application *app = find(winclient);
M src/Screen.ccsrc/Screen.cc

@@ -329,6 +329,7 @@ m_altname(altscreenname),

m_focus_control(new FocusControl(*this)), m_placement_strategy(new ScreenPlacement(*this)), m_xinerama_headinfo(0), + m_restart(false), m_shutdown(false) {

@@ -352,6 +353,19 @@ if (! managed) {

delete m_placement_strategy; m_placement_strategy = 0; delete m_focus_control; m_focus_control = 0; return; + } + + // check if we're the first EWMH compliant window manager on this screen + Atom wm_check = XInternAtom(disp, "_NET_SUPPORTING_WM_CHECK", False); + Atom xa_ret_type; + int ret_format; + unsigned long ret_nitems, ret_bytes_after; + unsigned char *ret_prop; + if (XGetWindowProperty(disp, m_root_window.window(), wm_check, 0l, 1l, + False, XA_WINDOW, &xa_ret_type, &ret_format, &ret_nitems, + &ret_bytes_after, &ret_prop) == Success) { + m_restart = (ret_prop != NULL); + XFree(ret_prop); } // TODO fluxgen: check if this is the right place

@@ -533,6 +547,10 @@

delete m_focus_control; delete m_placement_strategy; +} + +bool BScreen::isRestart() { + return Fluxbox::instance()->isStartup() && m_restart; } void BScreen::initWindows() {
M src/Screen.hhsrc/Screen.hh

@@ -247,6 +247,7 @@ const FbTk::ResourceManager &resourceManager() const { return m_resource_manager; }

const std::string &name() const { return m_name; } const std::string &altName() const { return m_altname; } bool isShuttingdown() const { return m_shutdown; } + bool isRestart(); PlacementStrategy &placementStrategy() { return *m_placement_strategy; } const PlacementStrategy &placementStrategy() const { return *m_placement_strategy; }

@@ -485,7 +486,7 @@ struct XineramaHeadInfo {

int x, y, width, height; } *m_xinerama_headinfo; - bool m_shutdown; + bool m_restart, m_shutdown; };