aboutsummaryrefslogtreecommitdiff
path: root/src/fluxbox.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-13 11:43:44 (GMT)
committerfluxgen <fluxgen>2003-05-13 11:43:44 (GMT)
commit33130ce0a6c5aaa3d1776d5bd4e373f0afc9d288 (patch)
tree2bfd06837b107a72fcaac48617737d2bb57a49c2 /src/fluxbox.cc
parente97f8d7816ee36e057082fc17fda61843f711fa2 (diff)
downloadfluxbox-33130ce0a6c5aaa3d1776d5bd4e373f0afc9d288.zip
fluxbox-33130ce0a6c5aaa3d1776d5bd4e373f0afc9d288.tar.bz2
fixed better error msg
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r--src/fluxbox.cc48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index c26f766..e85bf00 100644
--- a/src/fluxbox.cc
+++ b/src/fluxbox.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: fluxbox.cc,v 1.143 2003/05/13 00:20:49 fluxgen Exp $ 25// $Id: fluxbox.cc,v 1.144 2003/05/13 11:43:44 fluxgen Exp $
26 26
27#include "fluxbox.hh" 27#include "fluxbox.hh"
28 28
@@ -422,25 +422,30 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
422 m_RC_INIT_FILE("init") { 422 m_RC_INIT_FILE("init") {
423 423
424 424
425 if (s_singleton != 0) { 425 if (s_singleton != 0)
426 cerr<<"Fatal! There can only one instance of fluxbox class."<<endl; 426 throw string("Fatal! There can only one instance of fluxbox class.");
427 abort(); 427
428 if (display() == 0) {
429 //!! TODO: NLS
430 throw string("Can not connect to X server.\n"
431 "Make sure you started X before you start Fluxbox.");
428 } 432 }
429 433
430 // setup X error handler 434 // setup X error handler
431 XSetErrorHandler((XErrorHandler) handleXErrors); 435 XSetErrorHandler((XErrorHandler) handleXErrors);
432 436
433 //catch system signals 437 //catch system signals
434 SignalHandler *sigh = SignalHandler::instance(); 438 SignalHandler &sigh = SignalHandler::instance();
435 439
436 sigh->registerHandler(SIGSEGV, this); 440 sigh.registerHandler(SIGSEGV, this);
437 sigh->registerHandler(SIGFPE, this); 441 sigh.registerHandler(SIGFPE, this);
438 sigh->registerHandler(SIGTERM, this); 442 sigh.registerHandler(SIGTERM, this);
439 sigh->registerHandler(SIGINT, this); 443 sigh.registerHandler(SIGINT, this);
440 sigh->registerHandler(SIGCHLD, this); 444 sigh.registerHandler(SIGCHLD, this);
441 sigh->registerHandler(SIGHUP, this); 445 sigh.registerHandler(SIGHUP, this);
442 sigh->registerHandler(SIGUSR1, this); 446 sigh.registerHandler(SIGUSR1, this);
443 sigh->registerHandler(SIGUSR2, this); 447 sigh.registerHandler(SIGUSR2, this);
448
444 Display *disp = FbTk::App::instance()->display(); 449 Display *disp = FbTk::App::instance()->display();
445 //setup cursor bitmaps 450 //setup cursor bitmaps
446 cursor.session = XCreateFontCursor(disp, XC_left_ptr); 451 cursor.session = XCreateFontCursor(disp, XC_left_ptr);
@@ -530,11 +535,9 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
530 535
531 I18n *i18n = I18n::instance(); 536 I18n *i18n = I18n::instance();
532 if (m_screen_list.size() == 0) { 537 if (m_screen_list.size() == 0) {
533 throw string( 538 //!! TODO: NLS
534 i18n-> 539 throw string("Couldn't find screens to manage.\n"
535 getMessage( 540 "Make sure you don't have another window manager running.");
536 FBNLS::blackboxSet, FBNLS::blackboxNoManagableScreens,
537 "Fluxbox::Fluxbox: no managable screens found, aborting."));
538 } 541 }
539 542
540 XSynchronize(disp, False); 543 XSynchronize(disp, False);
@@ -545,7 +548,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name, const char *rcfile
545 m_timer.setTimeout(0); 548 m_timer.setTimeout(0);
546 m_timer.fireOnce(true); 549 m_timer.fireOnce(true);
547 550
548 //create keybindings handler and load keys file 551 // Create keybindings handler and load keys file
549 m_key.reset(new Keys(StringUtil::expandFilename(*m_rc_keyfile).c_str())); 552 m_key.reset(new Keys(StringUtil::expandFilename(*m_rc_keyfile).c_str()));
550 553
551 ungrab(); 554 ungrab();
@@ -571,12 +574,7 @@ void Fluxbox::eventLoop() {
571 574
572 if (last_bad_window != None && e.xany.window == last_bad_window) { 575 if (last_bad_window != None && e.xany.window == last_bad_window) {
573#ifdef DEBUG 576#ifdef DEBUG
574 fprintf(stderr, 577 cerr<<"Fluxbox::eventLoop(): removing bad window from event queue"<<endl;
575 I18n::instance()->
576 getMessage(
577 FBNLS::BaseDisplaySet, FBNLS::BaseDisplayBadWindowRemove,
578 "Fluxbox::eventLoop(): removing bad window "
579 "from event queue\n"));
580#endif // DEBUG 578#endif // DEBUG
581 } else { 579 } else {
582 last_bad_window = None; 580 last_bad_window = None;