aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2006-08-06 22:33:54 (GMT)
committermarkt <markt>2006-08-06 22:33:54 (GMT)
commit2d14b33ef4de3e8cd95474bc103fe3dba5cbb33b (patch)
tree58569f71d21584a1bf82e509ba9bf1e5123263c2
parent7b49c4a00bc8d0b9685868e5ad4699b8c5530ab9 (diff)
downloadfluxbox_pavel-2d14b33ef4de3e8cd95474bc103fe3dba5cbb33b.zip
fluxbox_pavel-2d14b33ef4de3e8cd95474bc103fe3dba5cbb33b.tar.bz2
distinguish between startup and restart
-rw-r--r--ChangeLog3
-rw-r--r--src/Remember.cc12
-rw-r--r--src/Screen.cc18
-rw-r--r--src/Screen.hh3
4 files changed, 29 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index a6acc44..091d220 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*06/08/06:
4 * Distinguish between startup and restart (Mark)
5 Screen.cc/hh Remember.cc
3*06/08/05: 6*06/08/05:
4 * Don't call placement strategy on maximized or fullscreen windows (Mark) 7 * Don't call placement strategy on maximized or fullscreen windows (Mark)
5 Window.cc 8 Window.cc
diff --git a/src/Remember.cc b/src/Remember.cc
index 9569b80..cf2c934 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -963,7 +963,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
963 return; // nothing to do 963 return; // nothing to do
964 964
965 // first, set the options that aren't preserved as window properties on 965 // first, set the options that aren't preserved as window properties on
966 // restart, then return if fluxbox is starting up -- we want restart to 966 // restart, then return if fluxbox is restarting -- we want restart to
967 // disturb the current window state as little as possible 967 // disturb the current window state as little as possible
968 Window leftwin = winclient.getGroupLeftWindow(); 968 Window leftwin = winclient.getGroupLeftWindow();
969 if (app->is_grouped && app->group == 0 && leftwin == None) 969 if (app->is_grouped && app->group == 0 && leftwin == None)
@@ -978,12 +978,12 @@ void Remember::setupFrame(FluxboxWindow &win) {
978 if (app->decostate_remember) 978 if (app->decostate_remember)
979 win.setDecorationMask(app->decostate); 979 win.setDecorationMask(app->decostate);
980 980
981 // now check if fluxbox is starting up
982 if (Fluxbox::instance()->isStartup())
983 return;
984
985 BScreen &screen = winclient.screen(); 981 BScreen &screen = winclient.screen();
986 982
983 // now check if fluxbox is restarting
984 if (screen.isRestart())
985 return;
986
987 if (app->workspace_remember) { 987 if (app->workspace_remember) {
988 // we use setWorkspace and not reassoc because we're still initialising 988 // we use setWorkspace and not reassoc because we're still initialising
989 win.setWorkspace(app->workspace); 989 win.setWorkspace(app->workspace);
@@ -1050,7 +1050,7 @@ void Remember::setupFrame(FluxboxWindow &win) {
1050 1050
1051void Remember::setupClient(WinClient &winclient) { 1051void Remember::setupClient(WinClient &winclient) {
1052 1052
1053 if (Fluxbox::instance()->isStartup()) 1053 if (winclient.screen().isRestart())
1054 return; // don't mess up windows on restart 1054 return; // don't mess up windows on restart
1055 1055
1056 Application *app = find(winclient); 1056 Application *app = find(winclient);
diff --git a/src/Screen.cc b/src/Screen.cc
index 22b41dd..d2117ff 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -329,6 +329,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
329 m_focus_control(new FocusControl(*this)), 329 m_focus_control(new FocusControl(*this)),
330 m_placement_strategy(new ScreenPlacement(*this)), 330 m_placement_strategy(new ScreenPlacement(*this)),
331 m_xinerama_headinfo(0), 331 m_xinerama_headinfo(0),
332 m_restart(false),
332 m_shutdown(false) { 333 m_shutdown(false) {
333 334
334 335
@@ -354,6 +355,19 @@ BScreen::BScreen(FbTk::ResourceManager &rm,
354 return; 355 return;
355 } 356 }
356 357
358 // check if we're the first EWMH compliant window manager on this screen
359 Atom wm_check = XInternAtom(disp, "_NET_SUPPORTING_WM_CHECK", False);
360 Atom xa_ret_type;
361 int ret_format;
362 unsigned long ret_nitems, ret_bytes_after;
363 unsigned char *ret_prop;
364 if (XGetWindowProperty(disp, m_root_window.window(), wm_check, 0l, 1l,
365 False, XA_WINDOW, &xa_ret_type, &ret_format, &ret_nitems,
366 &ret_bytes_after, &ret_prop) == Success) {
367 m_restart = (ret_prop != NULL);
368 XFree(ret_prop);
369 }
370
357 // TODO fluxgen: check if this is the right place 371 // TODO fluxgen: check if this is the right place
358 m_head_areas = new HeadArea[numHeads() ? numHeads() : 1]; 372 m_head_areas = new HeadArea[numHeads() ? numHeads() : 1];
359 373
@@ -535,6 +549,10 @@ BScreen::~BScreen() {
535 549
536} 550}
537 551
552bool BScreen::isRestart() {
553 return Fluxbox::instance()->isStartup() && m_restart;
554}
555
538void BScreen::initWindows() { 556void BScreen::initWindows() {
539 unsigned int nchild; 557 unsigned int nchild;
540 Window r, p, *children; 558 Window r, p, *children;
diff --git a/src/Screen.hh b/src/Screen.hh
index b0eb9dd..1778308 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -247,6 +247,7 @@ public:
247 const std::string &name() const { return m_name; } 247 const std::string &name() const { return m_name; }
248 const std::string &altName() const { return m_altname; } 248 const std::string &altName() const { return m_altname; }
249 bool isShuttingdown() const { return m_shutdown; } 249 bool isShuttingdown() const { return m_shutdown; }
250 bool isRestart();
250 251
251 PlacementStrategy &placementStrategy() { return *m_placement_strategy; } 252 PlacementStrategy &placementStrategy() { return *m_placement_strategy; }
252 const PlacementStrategy &placementStrategy() const { return *m_placement_strategy; } 253 const PlacementStrategy &placementStrategy() const { return *m_placement_strategy; }
@@ -485,7 +486,7 @@ private:
485 int x, y, width, height; 486 int x, y, width, height;
486 } *m_xinerama_headinfo; 487 } *m_xinerama_headinfo;
487 488
488 bool m_shutdown; 489 bool m_restart, m_shutdown;
489}; 490};
490 491
491 492