all repos — fluxbox @ 33130ce0a6c5aaa3d1776d5bd4e373f0afc9d288

custom fork of the fluxbox windowmanager

fixed better error msg
fluxgen fluxgen
commit

33130ce0a6c5aaa3d1776d5bd4e373f0afc9d288

parent

e97f8d7816ee36e057082fc17fda61843f711fa2

1 files changed, 23 insertions(+), 25 deletions(-)

jump to
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.143 2003/05/13 00:20:49 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.144 2003/05/13 11:43:44 fluxgen Exp $ #include "fluxbox.hh"

@@ -422,25 +422,30 @@ m_RC_PATH("fluxbox"),

m_RC_INIT_FILE("init") { - if (s_singleton != 0) { - cerr<<"Fatal! There can only one instance of fluxbox class."<<endl; - abort(); + if (s_singleton != 0) + throw string("Fatal! There can only one instance of fluxbox class."); + + if (display() == 0) { + //!! TODO: NLS + throw string("Can not connect to X server.\n" + "Make sure you started X before you start Fluxbox."); } // setup X error handler XSetErrorHandler((XErrorHandler) handleXErrors); //catch system signals - SignalHandler *sigh = SignalHandler::instance(); + SignalHandler &sigh = SignalHandler::instance(); - sigh->registerHandler(SIGSEGV, this); - sigh->registerHandler(SIGFPE, this); - sigh->registerHandler(SIGTERM, this); - sigh->registerHandler(SIGINT, this); - sigh->registerHandler(SIGCHLD, this); - sigh->registerHandler(SIGHUP, this); - sigh->registerHandler(SIGUSR1, this); - sigh->registerHandler(SIGUSR2, this); + sigh.registerHandler(SIGSEGV, this); + sigh.registerHandler(SIGFPE, this); + sigh.registerHandler(SIGTERM, this); + sigh.registerHandler(SIGINT, this); + sigh.registerHandler(SIGCHLD, this); + sigh.registerHandler(SIGHUP, this); + sigh.registerHandler(SIGUSR1, this); + sigh.registerHandler(SIGUSR2, this); + Display *disp = FbTk::App::instance()->display(); //setup cursor bitmaps cursor.session = XCreateFontCursor(disp, XC_left_ptr);

@@ -530,11 +535,9 @@ }

I18n *i18n = I18n::instance(); if (m_screen_list.size() == 0) { - throw string( - i18n-> - getMessage( - FBNLS::blackboxSet, FBNLS::blackboxNoManagableScreens, - "Fluxbox::Fluxbox: no managable screens found, aborting.")); + //!! TODO: NLS + throw string("Couldn't find screens to manage.\n" + "Make sure you don't have another window manager running."); } XSynchronize(disp, False);

@@ -545,7 +548,7 @@

m_timer.setTimeout(0); m_timer.fireOnce(true); - //create keybindings handler and load keys file + // Create keybindings handler and load keys file m_key.reset(new Keys(StringUtil::expandFilename(*m_rc_keyfile).c_str())); ungrab();

@@ -571,12 +574,7 @@ XNextEvent(display(), &e);

if (last_bad_window != None && e.xany.window == last_bad_window) { #ifdef DEBUG - fprintf(stderr, - I18n::instance()-> - getMessage( - FBNLS::BaseDisplaySet, FBNLS::BaseDisplayBadWindowRemove, - "Fluxbox::eventLoop(): removing bad window " - "from event queue\n")); + cerr<<"Fluxbox::eventLoop(): removing bad window from event queue"<<endl; #endif // DEBUG } else { last_bad_window = None;