From e2e94031f962513c746857349e8511b296d25986 Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 3 Jan 2007 18:59:43 +0000 Subject: don't run [startup] items on restart --- ChangeLog | 3 +++ doc/asciidoc/fluxbox.txt | 6 +++--- src/Remember.cc | 21 +++++++++++++-------- src/fluxbox.cc | 4 ++-- 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 @@ (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 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: 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: 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) { 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 @@ bool handleStartupItem(const string &line, int offset) { if (next <= 0) { cerr<<"Error parsing [startup] at column "<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 '"<execute(); - delete tmp_exec_cmd; - return true; - } + tmp_exec_cmd->execute(); + delete tmp_exec_cmd; + return true; }; }; // 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 "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 @@ -417,8 +419,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile 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()); -- cgit v0.11.2