]> Dogcows Code - chaz/openbox/blobdiff - src/openbox.cc
fixed condition that could cause 2 windows to look focused, and bad things to occur
[chaz/openbox] / src / openbox.cc
index aa7fc9f66fd4e44a5b2a8ac786ab297de5d0a8c3..4e098cb839d0f501c66ada6728806914b21054e5 100644 (file)
@@ -63,13 +63,14 @@ void Openbox::signalHandler(int signal)
     instance->restart();
     break;
 
-  case SUGHUP:
+  case SIGHUP:
   case SIGINT:
   case SIGTERM:
   case SIGPIPE:
     printf("Caught signal %d. Exiting.\n", signal);
     instance->shutdown();
     break;
+
   case SIGFPE:
   case SIGSEGV:
     printf("Caught signal %d. Aborting and dumping core.\n", signal);
@@ -109,6 +110,7 @@ Openbox::Openbox(int argc, char **argv)
   action.sa_handler = Openbox::signalHandler;
   action.sa_mask = sigset_t();
   action.sa_flags = SA_NOCLDSTOP | SA_NODEFER;
+  sigaction(SIGUSR1, &action, (struct sigaction *) 0);
   sigaction(SIGPIPE, &action, (struct sigaction *) 0);
   sigaction(SIGSEGV, &action, (struct sigaction *) 0);
   sigaction(SIGFPE, &action, (struct sigaction *) 0);
@@ -357,6 +359,13 @@ void Openbox::setFocusedClient(OBClient *c)
                    otk::OBProperty::Atom_Window,
                    (c && _focused_screen == *it) ? c->window() : None);
   }
+
+  // call the python Focus callbacks
+  EventData *data = new_event_data(_focused_screen->number(),
+                                   c ? c->window() : 0,
+                                   EventFocus, 0);
+  Openbox::instance->bindings()->fireEvent(data);
+  Py_XDECREF((PyObject*)data);
 }
 
 void Openbox::execute(int screen, const std::string &bin)
This page took 0.023292 seconds and 4 git commands to generate.