distinguish between startup and restart
This commit is contained in:
parent
7b49c4a00b
commit
2d14b33ef4
4 changed files with 29 additions and 7 deletions
|
@ -1,5 +1,8 @@
|
||||||
(Format: Year/Month/Day)
|
(Format: Year/Month/Day)
|
||||||
Changes for 1.0rc3:
|
Changes for 1.0rc3:
|
||||||
|
*06/08/06:
|
||||||
|
* Distinguish between startup and restart (Mark)
|
||||||
|
Screen.cc/hh Remember.cc
|
||||||
*06/08/05:
|
*06/08/05:
|
||||||
* Don't call placement strategy on maximized or fullscreen windows (Mark)
|
* Don't call placement strategy on maximized or fullscreen windows (Mark)
|
||||||
Window.cc
|
Window.cc
|
||||||
|
|
|
@ -963,7 +963,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
|
||||||
return; // nothing to do
|
return; // nothing to do
|
||||||
|
|
||||||
// first, set the options that aren't preserved as window properties on
|
// 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
|
// disturb the current window state as little as possible
|
||||||
Window leftwin = winclient.getGroupLeftWindow();
|
Window leftwin = winclient.getGroupLeftWindow();
|
||||||
if (app->is_grouped && app->group == 0 && leftwin == None)
|
if (app->is_grouped && app->group == 0 && leftwin == None)
|
||||||
|
@ -978,12 +978,12 @@ void Remember::setupFrame(FluxboxWindow &win) {
|
||||||
if (app->decostate_remember)
|
if (app->decostate_remember)
|
||||||
win.setDecorationMask(app->decostate);
|
win.setDecorationMask(app->decostate);
|
||||||
|
|
||||||
// now check if fluxbox is starting up
|
|
||||||
if (Fluxbox::instance()->isStartup())
|
|
||||||
return;
|
|
||||||
|
|
||||||
BScreen &screen = winclient.screen();
|
BScreen &screen = winclient.screen();
|
||||||
|
|
||||||
|
// now check if fluxbox is restarting
|
||||||
|
if (screen.isRestart())
|
||||||
|
return;
|
||||||
|
|
||||||
if (app->workspace_remember) {
|
if (app->workspace_remember) {
|
||||||
// we use setWorkspace and not reassoc because we're still initialising
|
// we use setWorkspace and not reassoc because we're still initialising
|
||||||
win.setWorkspace(app->workspace);
|
win.setWorkspace(app->workspace);
|
||||||
|
@ -1050,7 +1050,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
|
||||||
|
|
||||||
void Remember::setupClient(WinClient &winclient) {
|
void Remember::setupClient(WinClient &winclient) {
|
||||||
|
|
||||||
if (Fluxbox::instance()->isStartup())
|
if (winclient.screen().isRestart())
|
||||||
return; // don't mess up windows on restart
|
return; // don't mess up windows on restart
|
||||||
|
|
||||||
Application *app = find(winclient);
|
Application *app = find(winclient);
|
||||||
|
|
|
@ -329,6 +329,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
||||||
m_focus_control(new FocusControl(*this)),
|
m_focus_control(new FocusControl(*this)),
|
||||||
m_placement_strategy(new ScreenPlacement(*this)),
|
m_placement_strategy(new ScreenPlacement(*this)),
|
||||||
m_xinerama_headinfo(0),
|
m_xinerama_headinfo(0),
|
||||||
|
m_restart(false),
|
||||||
m_shutdown(false) {
|
m_shutdown(false) {
|
||||||
|
|
||||||
|
|
||||||
|
@ -354,6 +355,19 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
|
||||||
return;
|
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
|
// TODO fluxgen: check if this is the right place
|
||||||
m_head_areas = new HeadArea[numHeads() ? numHeads() : 1];
|
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() {
|
void BScreen::initWindows() {
|
||||||
unsigned int nchild;
|
unsigned int nchild;
|
||||||
Window r, p, *children;
|
Window r, p, *children;
|
||||||
|
|
|
@ -247,6 +247,7 @@ public:
|
||||||
const std::string &name() const { return m_name; }
|
const std::string &name() const { return m_name; }
|
||||||
const std::string &altName() const { return m_altname; }
|
const std::string &altName() const { return m_altname; }
|
||||||
bool isShuttingdown() const { return m_shutdown; }
|
bool isShuttingdown() const { return m_shutdown; }
|
||||||
|
bool isRestart();
|
||||||
|
|
||||||
PlacementStrategy &placementStrategy() { return *m_placement_strategy; }
|
PlacementStrategy &placementStrategy() { return *m_placement_strategy; }
|
||||||
const PlacementStrategy &placementStrategy() const { return *m_placement_strategy; }
|
const PlacementStrategy &placementStrategy() const { return *m_placement_strategy; }
|
||||||
|
@ -485,7 +486,7 @@ private:
|
||||||
int x, y, width, height;
|
int x, y, width, height;
|
||||||
} *m_xinerama_headinfo;
|
} *m_xinerama_headinfo;
|
||||||
|
|
||||||
bool m_shutdown;
|
bool m_restart, m_shutdown;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue