diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 56 |
1 files changed, 31 insertions, 25 deletions
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 | ||
464 | int Fluxbox::initScreen(int scrnr) { | 486 | void 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 | ||