all repos — fluxbox @ d6a3af53ffacbcd89e8161b5a5908ad468285b9a

custom fork of the fluxbox windowmanager

don't run [startup] items if fluxbox fails to load
markt markt
commit

d6a3af53ffacbcd89e8161b5a5908ad468285b9a

parent

e9dd7670f36e8b32ee8dd2b52e1c4f31f808b35c

3 files changed, 33 insertions(+), 25 deletions(-)

jump to
M ChangeLogChangeLog

@@ -2,6 +2,8 @@ (Format: Year/Month/Day)

Changes for 1.0rc3: *07/01/01: * Happy New Year! + * Don't run [startup] items in apps file if fluxbox fails to start (Mark) + fluxbox.cc/hh * Don't run [startup] items in apps file on reconfigure (Mark) Remember.cc * Fix data type of data passed to set _NET_FRAME_EXTENTS (Simon)
M src/fluxbox.ccsrc/fluxbox.cc

@@ -314,9 +314,6 @@

load_rc(); // setup atom handlers before we create any windows -#ifdef REMEMBER - addAtomHandler(new Remember(), "remember"); // for remembering window attribs -#endif // REMEMBER #ifdef USE_NEWWMSPEC addAtomHandler(new Ewmh(), "ewmh"); // for Extended window manager atom support #endif // USE_NEWWMSPEC

@@ -382,12 +379,24 @@ swap(scrtmp, screens);

} } - // init all "screens" - for(size_t s = 0; s < screens.size(); s++) - initScreen(screens[s]); + // create screens + for (size_t s = 0; s < screens.size(); s++) { + char scrname[128], altscrname[128]; + sprintf(scrname, "session.screen%d", screens[s]); + sprintf(altscrname, "session.Screen%d", screens[s]); + BScreen *screen = new BScreen(m_screen_rm.lock(), + scrname, altscrname, + screens[s], getNumberOfLayers()); - XAllowEvents(disp, ReplayPointer, CurrentTime); + // already handled + if (! screen->isScreenManaged()) { + delete screen; + continue; + } + // add to our list + m_screen_list.push_back(screen); + } if (m_screen_list.empty()) { throw _FB_CONSOLETEXT(Fluxbox, ErrorNoScreens,

@@ -395,6 +404,19 @@ "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"); } + // parse apps file after creating screens but before creating windows +#ifdef REMEMBER + addAtomHandler(new Remember(), "remember"); // for remembering window attribs +#endif // REMEMBER + + // init all "screens" + ScreenList::iterator it = m_screen_list.begin(); + ScreenList::iterator it_end = m_screen_list.end(); + 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

@@ -461,24 +483,9 @@ clearMenuFilenames();

} -int Fluxbox::initScreen(int scrnr) { +void Fluxbox::initScreen(BScreen *screen) { Display* disp = display(); - char scrname[128], altscrname[128]; - sprintf(scrname, "session.screen%d", scrnr); - sprintf(altscrname, "session.Screen%d", scrnr); - BScreen *screen = new BScreen(m_screen_rm.lock(), - scrname, altscrname, - scrnr, getNumberOfLayers()); - - // already handled - if (! screen->isScreenManaged()) { - delete screen; - return 0; - } - - // add to our list - m_screen_list.push_back(screen); // now we can create menus (which needs this screen to be in screen_list) screen->initMenus();

@@ -534,7 +541,6 @@ if (screen->slit())

screen->slit()->show(); #endif // SLIT - return 1; }
M src/fluxbox.hhsrc/fluxbox.hh

@@ -101,7 +101,7 @@ // Not currently implemented until we decide how it'll be used

//WinClient *searchGroup(Window); WinClient *searchWindow(Window); - int initScreen(int screen_nr); + void initScreen(BScreen *screen); BScreen *searchScreen(Window w); unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; }