don't run [startup] items on restart
markt markt
4 files changed,
21 insertions(+),
13 deletions(-)
M
ChangeLog
→
ChangeLog
@@ -1,5 +1,8 @@
(Format: Year/Month/Day) Changes for 1.0rc3: +*07/01/03: + * Don't run [startup] items in apps file on fluxbox restart (Mark) + Remember.cc fluxbox.cc *07/01/02: * Replace `which' in fbsetbg and fbgm with `command -v' (Mark) util/fbsetbg fluxbox-generate_menu.in
M
doc/asciidoc/fluxbox.txt
→
doc/asciidoc/fluxbox.txt
@@ -1528,9 +1528,9 @@ when a window is closed. Set this option if you want previous settings to
be saved when the window is closed. The apps file also allows you to specify applications that should be started -on fluxbox startup using [startup] (options) {application} lines. Options -could be used to specify the screen, not the workspace, on which the -application should be started. +on fluxbox startup using [startup] (options) {command} lines. Currently, the +only valid option is (screen=NN), where NN is the screen number on which the +command should be run. Finally, you can set windows to group together by using the `apps' file. This can be achieved with regular expressions using:
M
src/Remember.cc
→
src/Remember.cc
@@ -169,7 +169,7 @@ // return true if all ok, false on error
bool handleStartupItem(const string &line, int offset) { int next = 0; string str; - unsigned int screen = 0; + unsigned int screen = Fluxbox::instance()->keyScreen()->screenNumber(); // accept some options, for now only "screen=NN" // these option are given in parentheses before the command@@ -206,15 +206,20 @@
if (next <= 0) { cerr<<"Error parsing [startup] at column "<<offset<<" - expecting {command}."<<endl; return false; - } else { - FbCommands::ExecuteCmd *tmp_exec_cmd = new FbCommands::ExecuteCmd(str, screen); + } + + // don't run command if fluxbox is restarting + if (Fluxbox::instance()->findScreen(screen)->isRestart()) + // the line was successfully read; we just didn't use it + return true; + + FbCommands::ExecuteCmd *tmp_exec_cmd = new FbCommands::ExecuteCmd(str, screen); #ifdef DEBUG - cerr<<"Executing startup command '"<<str<<"' on screen "<<screen<<endl; + cerr<<"Executing startup command '"<<str<<"' on screen "<<screen<<endl; #endif // DEBUG - tmp_exec_cmd->execute(); - delete tmp_exec_cmd; - return true; - } + tmp_exec_cmd->execute(); + delete tmp_exec_cmd; + return true; }; }; // end anonymous namespace
M
src/fluxbox.cc
→
src/fluxbox.cc
@@ -404,6 +404,8 @@ "Couldn't find screens to manage.\nMake sure you don't have another window manager running.",
"Error message when no unmanaged screens found - usually means another window manager is running"); } + m_keyscreen = m_mousescreen = m_screen_list.front(); + // parse apps file after creating screens but before creating windows #ifdef REMEMBER addAtomHandler(new Remember(), "remember"); // for remembering window attribs@@ -416,8 +418,6 @@ for(; it != it_end; ++it)
initScreen(*it); XAllowEvents(disp, ReplayPointer, CurrentTime); - - m_keyscreen = m_mousescreen = m_screen_list.front(); // setup theme manager to have our style file ready to be scanned FbTk::ThemeManager::instance().load(getStyleFilename(), getStyleOverlayFilename());