X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.cc;h=b44a1861f03acb1d64f1f32863db400916b6126a;hb=c8e246f8de5af9963b22cc104d22ca10772028dd;hp=b28decc23a68b65d528ef489158f91c574727bc5;hpb=f71a1fc7d2d7f3c860fe137427a534ddef09fd17;p=chaz%2Fopenbox diff --git a/src/openbox.cc b/src/openbox.cc index b28decc2..b44a1861 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -144,12 +144,15 @@ Openbox::Openbox(int argc, char **argv) // initialize all the screens OBScreen *screen; - screen = new OBScreen(0); - if (screen->managed()) { - _screens.push_back(screen); - // XXX: "change to" the first workspace on the screen to initialize stuff - } else - delete screen; + int i = _single ? DefaultScreen(otk::OBDisplay::display) : 0; + int max = _single ? i + 1 : ScreenCount(otk::OBDisplay::display); + for (; i < max; ++i) { + screen = new OBScreen(i); + if (screen->managed()) + _screens.push_back(screen); + else + delete screen; + } if (_screens.empty()) { printf(_("No screens were found without a window manager. Exiting.\n")); @@ -240,6 +243,8 @@ void Openbox::parseCommandLine(int argc, char **argv) _scriptfilepath = argv[i]; } else if (arg == "-sync") { _sync = true; + } else if (arg == "-single") { + _single = true; } else if (arg == "-version") { showVersion(); ::exit(0); @@ -272,16 +277,19 @@ void Openbox::showHelp() printf(_("Usage: %s [OPTIONS...]\n\ Options:\n\ -display use display connection.\n\ + -single run on a single screen (default is to run every one).\n\ -rc use alternate resource file.\n\ -menu use alternate menu file.\n\ -script use alternate startup script file.\n\ + -sync run in synchronous mode (for debugging).\n\ -version display version and exit.\n\ -help display this help text and exit.\n\n"), _argv[0]); printf(_("Compile time options:\n\ Debugging: %s\n\ Shape: %s\n\ - Xinerama: %s\n"), + Xinerama: %s\n\ + Xkb: %s\n"), #ifdef DEBUG _("yes"), #else // !DEBUG @@ -295,10 +303,16 @@ void Openbox::showHelp() #endif // SHAPE #ifdef XINERAMA - _("yes") + _("yes"), #else // !XINERAMA - _("no") + _("no"), #endif // XINERAMA + +#ifdef XKB + _("yes") +#else // !XKB + _("no") +#endif // XKB ); } @@ -306,7 +320,7 @@ void Openbox::showHelp() void Openbox::eventLoop() { while (!_shutdown) { - _timermanager.fire(); + _timermanager.fire(!_sync); // wait if not in sync mode dispatchEvents(); // from OtkEventDispatcher XFlush(otk::OBDisplay::display); // flush here before we go wait for timers } @@ -359,6 +373,10 @@ void Openbox::setFocusedClient(OBClient *c) otk::OBProperty::Atom_Window, (c && _focused_screen == *it) ? c->window() : None); } + + // call the python Focus callbacks + EventData data(_focused_screen->number(), c, EventFocus, 0); + Openbox::instance->bindings()->fireEvent(&data); } void Openbox::execute(int screen, const std::string &bin)