don't run [startup] items on restart
This commit is contained in:
parent
aeac1b3344
commit
e2e94031f9
4 changed files with 22 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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 "<<offset<<" - expecting {command}."<<endl;
|
||||
return false;
|
||||
} else {
|
||||
FbCommands::ExecuteCmd *tmp_exec_cmd = new FbCommands::ExecuteCmd(str, screen);
|
||||
#ifdef DEBUG
|
||||
cerr<<"Executing startup command '"<<str<<"' on screen "<<screen<<endl;
|
||||
#endif // DEBUG
|
||||
tmp_exec_cmd->execute();
|
||||
delete tmp_exec_cmd;
|
||||
return true;
|
||||
}
|
||||
|
||||
// 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;
|
||||
#endif // DEBUG
|
||||
tmp_exec_cmd->execute();
|
||||
delete tmp_exec_cmd;
|
||||
return true;
|
||||
};
|
||||
|
||||
}; // end anonymous namespace
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in a new issue