aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-01-03 18:59:43 (GMT)
committermarkt <markt>2007-01-03 18:59:43 (GMT)
commite2e94031f962513c746857349e8511b296d25986 (patch)
tree932286e4949023ac8803671ca6398f4a71a4ef68
parentaeac1b334441a348a411fc01a1568ece74b76a2f (diff)
downloadfluxbox-e2e94031f962513c746857349e8511b296d25986.zip
fluxbox-e2e94031f962513c746857349e8511b296d25986.tar.bz2
don't run [startup] items on restart
-rw-r--r--ChangeLog3
-rw-r--r--doc/asciidoc/fluxbox.txt6
-rw-r--r--src/Remember.cc21
-rw-r--r--src/fluxbox.cc4
4 files changed, 21 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index d5498b2..93847ec 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*07/01/03:
4 * Don't run [startup] items in apps file on fluxbox restart (Mark)
5 Remember.cc fluxbox.cc
3*07/01/02: 6*07/01/02:
4 * Replace `which' in fbsetbg and fbgm with `command -v' (Mark) 7 * Replace `which' in fbsetbg and fbgm with `command -v' (Mark)
5 util/fbsetbg fluxbox-generate_menu.in 8 util/fbsetbg fluxbox-generate_menu.in
diff --git a/doc/asciidoc/fluxbox.txt b/doc/asciidoc/fluxbox.txt
index 2e143ca..6533e07 100644
--- a/doc/asciidoc/fluxbox.txt
+++ b/doc/asciidoc/fluxbox.txt
@@ -1528,9 +1528,9 @@ curly brackets:
1528 be saved when the window is closed. 1528 be saved when the window is closed.
1529 1529
1530The apps file also allows you to specify applications that should be started 1530The apps file also allows you to specify applications that should be started
1531on fluxbox startup using [startup] (options) {application} lines. Options 1531on fluxbox startup using [startup] (options) {command} lines. Currently, the
1532could be used to specify the screen, not the workspace, on which the 1532only valid option is (screen=NN), where NN is the screen number on which the
1533application should be started. 1533command should be run.
1534 1534
1535Finally, you can set windows to group together by using the `apps' file. This 1535Finally, you can set windows to group together by using the `apps' file. This
1536can be achieved with regular expressions using: 1536can be achieved with regular expressions using:
diff --git a/src/Remember.cc b/src/Remember.cc
index d39cd3e..f084677 100644
--- a/src/Remember.cc
+++ b/src/Remember.cc
@@ -169,7 +169,7 @@ FbTk::Menu *createRememberMenu(BScreen &screen) {
169bool handleStartupItem(const string &line, int offset) { 169bool handleStartupItem(const string &line, int offset) {
170 int next = 0; 170 int next = 0;
171 string str; 171 string str;
172 unsigned int screen = 0; 172 unsigned int screen = Fluxbox::instance()->keyScreen()->screenNumber();
173 173
174 // accept some options, for now only "screen=NN" 174 // accept some options, for now only "screen=NN"
175 // these option are given in parentheses before the command 175 // these option are given in parentheses before the command
@@ -206,15 +206,20 @@ bool handleStartupItem(const string &line, int offset) {
206 if (next <= 0) { 206 if (next <= 0) {
207 cerr<<"Error parsing [startup] at column "<<offset<<" - expecting {command}."<<endl; 207 cerr<<"Error parsing [startup] at column "<<offset<<" - expecting {command}."<<endl;
208 return false; 208 return false;
209 } else { 209 }
210 FbCommands::ExecuteCmd *tmp_exec_cmd = new FbCommands::ExecuteCmd(str, screen); 210
211 // don't run command if fluxbox is restarting
212 if (Fluxbox::instance()->findScreen(screen)->isRestart())
213 // the line was successfully read; we just didn't use it
214 return true;
215
216 FbCommands::ExecuteCmd *tmp_exec_cmd = new FbCommands::ExecuteCmd(str, screen);
211#ifdef DEBUG 217#ifdef DEBUG
212 cerr<<"Executing startup command '"<<str<<"' on screen "<<screen<<endl; 218 cerr<<"Executing startup command '"<<str<<"' on screen "<<screen<<endl;
213#endif // DEBUG 219#endif // DEBUG
214 tmp_exec_cmd->execute(); 220 tmp_exec_cmd->execute();
215 delete tmp_exec_cmd; 221 delete tmp_exec_cmd;
216 return true; 222 return true;
217 }
218}; 223};
219 224
220}; // end anonymous namespace 225}; // end anonymous namespace
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 16e27b8..a8290e5 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -404,6 +404,8 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
404 "Error message when no unmanaged screens found - usually means another window manager is running"); 404 "Error message when no unmanaged screens found - usually means another window manager is running");
405 } 405 }
406 406
407 m_keyscreen = m_mousescreen = m_screen_list.front();
408
407 // parse apps file after creating screens but before creating windows 409 // parse apps file after creating screens but before creating windows
408#ifdef REMEMBER 410#ifdef REMEMBER
409 addAtomHandler(new Remember(), "remember"); // for remembering window attribs 411 addAtomHandler(new Remember(), "remember"); // for remembering window attribs
@@ -417,8 +419,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
417 419
418 XAllowEvents(disp, ReplayPointer, CurrentTime); 420 XAllowEvents(disp, ReplayPointer, CurrentTime);
419 421
420 m_keyscreen = m_mousescreen = m_screen_list.front();
421
422 // setup theme manager to have our style file ready to be scanned 422 // setup theme manager to have our style file ready to be scanned
423 FbTk::ThemeManager::instance().load(getStyleFilename(), getStyleOverlayFilename()); 423 FbTk::ThemeManager::instance().load(getStyleFilename(), getStyleOverlayFilename());
424 424