]> Dogcows Code - chaz/openbox/blobdiff - src/openbox.cc
Added color reduction for 16bpp displays
[chaz/openbox] / src / openbox.cc
index 89948118f7ff37cc4721a4fb7048ad2a504463bd..edee736e32f6a10c0ef5feaff1029774414d6500 100644 (file)
@@ -14,6 +14,7 @@
 #include "otk/assassin.hh"
 #include "otk/property.hh"
 #include "otk/util.hh"
+#include "otk/rendercolor.hh"
 
 extern "C" {
 #include <X11/cursorfont.h>
@@ -43,6 +44,10 @@ extern "C" {
 #  include <sys/select.h>
 #endif // HAVE_SYS_SELECT_H
 
+#ifdef    HAVE_SYS_WAIT_H
+#  include <sys/wait.h>
+#endif // HAVE_SYS_WAIT_H
+
 #include "gettext.h"
 #define _(str) gettext(str)
 }
@@ -62,6 +67,10 @@ void Openbox::signalHandler(int signal)
     openbox->restart();
     break;
 
+  case SIGCHLD:
+    wait(NULL);
+    break;
+
   case SIGHUP:
   case SIGINT:
   case SIGTERM:
@@ -113,7 +122,12 @@ Openbox::Openbox(int argc, char **argv)
   sigaction(SIGTERM, &action, (struct sigaction *) 0);
   sigaction(SIGINT, &action, (struct sigaction *) 0);
   sigaction(SIGHUP, &action, (struct sigaction *) 0);
+  sigaction(SIGCHLD, &action, (struct sigaction *) 0);
+
+  // anything that died while we were restarting won't give us a SIGCHLD
+  while (waitpid(-1, NULL, WNOHANG) > 0);
 
+  otk::RenderColor::initialize();
   otk::Timer::initialize();
   otk::Property::initialize();
   _actions = new Actions();
@@ -136,6 +150,7 @@ Openbox::Openbox(int argc, char **argv)
   python_exec(SCRIPTDIR"/config.py"); // load openbox config values
   // run all of the python scripts
   python_exec(SCRIPTDIR"/builtins.py"); // builtin callbacks
+  python_exec(SCRIPTDIR"/focus.py"); // focus helpers
   // run the user's script or the system defaults if that fails
   if (!python_exec(_scriptfilepath.c_str()))
     python_exec(SCRIPTDIR"/defaults.py"); // system default bahaviors
@@ -196,13 +211,12 @@ Openbox::~Openbox()
   //otk::display->destroy();
 
   otk::Timer::destroy();
+  otk::RenderColor::destroy();
 
   if (_restart) {
     if (!_restart_prog.empty()) {
-      const std::string &dstr =
-        otk::display->screenInfo(first_screen)->displayString();
-      otk::putenv(const_cast<char *>(dstr.c_str()));
-      execlp(_restart_prog.c_str(), _restart_prog.c_str(), NULL);
+      otk::putenv(otk::display->screenInfo(first_screen)->displayString());
+      execl("/bin/sh", "/bin/sh", "-c", _restart_prog.c_str(), NULL); 
       perror(_restart_prog.c_str());
     }
     
This page took 0.023145 seconds and 4 git commands to generate.