X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fopenbox.cc;h=4d2f102479c266d781d580d2d24f9fb657e440cd;hb=105bd729e8341bacce630f2780f0a9a5a0102526;hp=436c09fadb6ec9c6eb5bfd3976b812bc790adebe;hpb=14cf42ff0780bf58a6b54c9443c87c7402b61faa;p=chaz%2Fopenbox diff --git a/src/openbox.cc b/src/openbox.cc index 436c09fa..4d2f1024 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -134,8 +134,7 @@ Openbox::Openbox(int argc, char **argv) // load config values python_exec(SCRIPTDIR"/config.py"); // load openbox config values // run all of the python scripts - python_exec(SCRIPTDIR"/clientmotion.py"); // moving and resizing clients - python_exec(SCRIPTDIR"/clicks.py"); // titlebar/root clicks and dblclicks + python_exec(SCRIPTDIR"/builtins.py"); // builtin callbacks // run the user's script python_exec(_scriptfilepath.c_str()); @@ -173,11 +172,10 @@ Openbox::~Openbox() { _state = State_Exiting; // time to kill everything - delete _bindings; - delete _actions; - std::for_each(_screens.begin(), _screens.end(), otk::PointerAssassin()); + delete _bindings; + delete _actions; delete _property; python_destroy(); @@ -328,5 +326,26 @@ void Openbox::setFocusedClient(OBClient *c) } } +void Openbox::execute(int screen, const std::string &bin) +{ +#ifdef __EMX__ + // XXX: whats this for? windows? + spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", bin.c_str(), NULL); +#else // __EMX__ + if (screen >= ScreenCount(otk::OBDisplay::display)) + screen = 0; + const std::string &dstr = + otk::OBDisplay::screenInfo(screen)->displayString(); + + if (! fork()) { + setsid(); + int ret = putenv(const_cast(dstr.c_str())); + assert(ret != -1); + ret = execl("/bin/sh", "/bin/sh", "-c", bin.c_str(), NULL); + exit(ret); + } +#endif // __EMX__ +} + }