]> Dogcows Code - chaz/openbox/blobdiff - src/openbox.cc
SIGHIP not SUGHUP
[chaz/openbox] / src / openbox.cc
index 6ed00a2c84bbff5d4cd377af961d69bdf05a0999..4d1de42afbb9341b577e03b6e7ad25894b6db997 100644 (file)
@@ -58,16 +58,17 @@ Openbox *Openbox::instance  = (Openbox *) 0;
 void Openbox::signalHandler(int signal)
 {
   switch (signal) {
+  case SIGUSR1:
+    printf("Caught SIGUSR1 signal. Restarting.\n");
+    instance->restart();
+    break;
+
   case SIGHUP:
-    // XXX: Do something with HUP? Really shouldn't, we get this when X shuts
-    //      down and hangs-up on us.
-    
   case SIGINT:
   case SIGTERM:
   case SIGPIPE:
     printf("Caught signal %d. Exiting.\n", signal);
     instance->shutdown();
-
     break;
   case SIGFPE:
   case SIGSEGV:
@@ -347,6 +348,15 @@ void Openbox::setFocusedClient(OBClient *c)
     XSetInputFocus(otk::OBDisplay::display, _focused_screen->focuswindow(),
                    RevertToNone, CurrentTime);
   }
+  // set the NET_ACTIVE_WINDOW hint for all screens
+  ScreenList::iterator it, end = _screens.end();
+  for (it = _screens.begin(); it != end; ++it) {
+    int num = (*it)->number();
+    Window root = otk::OBDisplay::screenInfo(num)->rootWindow();
+    _property->set(root, otk::OBProperty::net_active_window,
+                   otk::OBProperty::Atom_Window,
+                   (c && _focused_screen == *it) ? c->window() : None);
+  }
 }
 
 void Openbox::execute(int screen, const std::string &bin)
This page took 0.025973 seconds and 4 git commands to generate.