distinguish between startup and restart

This commit is contained in:
markt 2006-08-06 22:33:54 +00:00
parent 7b49c4a00b
commit 2d14b33ef4
4 changed files with 29 additions and 7 deletions

View file

@ -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

View file

@ -963,7 +963,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
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,12 +978,12 @@ void Remember::setupFrame(FluxboxWindow &win) {
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
win.setWorkspace(app->workspace);
@ -1050,7 +1050,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
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);

View file

@ -329,6 +329,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
m_focus_control(new FocusControl(*this)),
m_placement_strategy(new ScreenPlacement(*this)),
m_xinerama_headinfo(0),
m_restart(false),
m_shutdown(false) {
@ -354,6 +355,19 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
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
m_head_areas = new HeadArea[numHeads() ? numHeads() : 1];
@ -535,6 +549,10 @@ BScreen::~BScreen() {
}
bool BScreen::isRestart() {
return Fluxbox::instance()->isStartup() && m_restart;
}
void BScreen::initWindows() {
unsigned int nchild;
Window r, p, *children;

View file

@ -247,6 +247,7 @@ public:
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 @@ private:
int x, y, width, height;
} *m_xinerama_headinfo;
bool m_shutdown;
bool m_restart, m_shutdown;
};