aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-01-01 01:44:35 (GMT)
committermarkt <markt>2007-01-01 01:44:35 (GMT)
commitd6a3af53ffacbcd89e8161b5a5908ad468285b9a (patch)
treeb09f4321d5d71eab5f8be59c94c25ce072018c47
parente9dd7670f36e8b32ee8dd2b52e1c4f31f808b35c (diff)
downloadfluxbox_pavel-d6a3af53ffacbcd89e8161b5a5908ad468285b9a.zip
fluxbox_pavel-d6a3af53ffacbcd89e8161b5a5908ad468285b9a.tar.bz2
don't run [startup] items if fluxbox fails to load
-rw-r--r--ChangeLog2
-rw-r--r--src/fluxbox.cc56
-rw-r--r--src/fluxbox.hh2
3 files changed, 34 insertions, 26 deletions
diff --git a/ChangeLog b/ChangeLog
index f3fc642..940dd40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
2Changes for 1.0rc3: 2Changes for 1.0rc3:
3*07/01/01: 3*07/01/01:
4 * Happy New Year! 4 * Happy New Year!
5 * Don't run [startup] items in apps file if fluxbox fails to start (Mark)
6 fluxbox.cc/hh
5 * Don't run [startup] items in apps file on reconfigure (Mark) 7 * Don't run [startup] items in apps file on reconfigure (Mark)
6 Remember.cc 8 Remember.cc
7 * Fix data type of data passed to set _NET_FRAME_EXTENTS (Simon) 9 * Fix data type of data passed to set _NET_FRAME_EXTENTS (Simon)
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 9fe22f7..16e27b8 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -314,9 +314,6 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
314 load_rc(); 314 load_rc();
315 315
316 // setup atom handlers before we create any windows 316 // setup atom handlers before we create any windows
317#ifdef REMEMBER
318 addAtomHandler(new Remember(), "remember"); // for remembering window attribs
319#endif // REMEMBER
320#ifdef USE_NEWWMSPEC 317#ifdef USE_NEWWMSPEC
321 addAtomHandler(new Ewmh(), "ewmh"); // for Extended window manager atom support 318 addAtomHandler(new Ewmh(), "ewmh"); // for Extended window manager atom support
322#endif // USE_NEWWMSPEC 319#endif // USE_NEWWMSPEC
@@ -382,12 +379,24 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
382 } 379 }
383 } 380 }
384 381
385 // init all "screens" 382 // create screens
386 for(size_t s = 0; s < screens.size(); s++) 383 for (size_t s = 0; s < screens.size(); s++) {
387 initScreen(screens[s]); 384 char scrname[128], altscrname[128];
388 385 sprintf(scrname, "session.screen%d", screens[s]);
389 XAllowEvents(disp, ReplayPointer, CurrentTime); 386 sprintf(altscrname, "session.Screen%d", screens[s]);
387 BScreen *screen = new BScreen(m_screen_rm.lock(),
388 scrname, altscrname,
389 screens[s], getNumberOfLayers());
390
391 // already handled
392 if (! screen->isScreenManaged()) {
393 delete screen;
394 continue;
395 }
390 396
397 // add to our list
398 m_screen_list.push_back(screen);
399 }
391 400
392 if (m_screen_list.empty()) { 401 if (m_screen_list.empty()) {
393 throw _FB_CONSOLETEXT(Fluxbox, ErrorNoScreens, 402 throw _FB_CONSOLETEXT(Fluxbox, ErrorNoScreens,
@@ -395,6 +404,19 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
395 "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");
396 } 405 }
397 406
407 // parse apps file after creating screens but before creating windows
408#ifdef REMEMBER
409 addAtomHandler(new Remember(), "remember"); // for remembering window attribs
410#endif // REMEMBER
411
412 // init all "screens"
413 ScreenList::iterator it = m_screen_list.begin();
414 ScreenList::iterator it_end = m_screen_list.end();
415 for(; it != it_end; ++it)
416 initScreen(*it);
417
418 XAllowEvents(disp, ReplayPointer, CurrentTime);
419
398 m_keyscreen = m_mousescreen = m_screen_list.front(); 420 m_keyscreen = m_mousescreen = m_screen_list.front();
399 421
400 // 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
@@ -461,24 +483,9 @@ Fluxbox::~Fluxbox() {
461} 483}
462 484
463 485
464int Fluxbox::initScreen(int scrnr) { 486void Fluxbox::initScreen(BScreen *screen) {
465 487
466 Display* disp = display(); 488 Display* disp = display();
467 char scrname[128], altscrname[128];
468 sprintf(scrname, "session.screen%d", scrnr);
469 sprintf(altscrname, "session.Screen%d", scrnr);
470 BScreen *screen = new BScreen(m_screen_rm.lock(),
471 scrname, altscrname,
472 scrnr, getNumberOfLayers());
473
474 // already handled
475 if (! screen->isScreenManaged()) {
476 delete screen;
477 return 0;
478 }
479
480 // add to our list
481 m_screen_list.push_back(screen);
482 489
483 // now we can create menus (which needs this screen to be in screen_list) 490 // now we can create menus (which needs this screen to be in screen_list)
484 screen->initMenus(); 491 screen->initMenus();
@@ -534,7 +541,6 @@ int Fluxbox::initScreen(int scrnr) {
534 screen->slit()->show(); 541 screen->slit()->show();
535#endif // SLIT 542#endif // SLIT
536 543
537 return 1;
538} 544}
539 545
540 546
diff --git a/src/fluxbox.hh b/src/fluxbox.hh
index 9855637..c80459a 100644
--- a/src/fluxbox.hh
+++ b/src/fluxbox.hh
@@ -101,7 +101,7 @@ public:
101 //WinClient *searchGroup(Window); 101 //WinClient *searchGroup(Window);
102 WinClient *searchWindow(Window); 102 WinClient *searchWindow(Window);
103 103
104 int initScreen(int screen_nr); 104 void initScreen(BScreen *screen);
105 BScreen *searchScreen(Window w); 105 BScreen *searchScreen(Window w);
106 106
107 unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; } 107 unsigned int getDoubleClickInterval() const { return *m_rc_double_click_interval; }