]> Dogcows Code - chaz/openbox/commitdiff
add startup and shutdown callback events for each screen
authorDana Jansens <danakj@orodu.net>
Tue, 7 Jan 2003 02:43:56 +0000 (02:43 +0000)
committerDana Jansens <danakj@orodu.net>
Tue, 7 Jan 2003 02:43:56 +0000 (02:43 +0000)
src/python.hh
src/screen.cc

index 948e9a72af9b3bede62c58a802e7e645ab9819ae..2f77932138c724ae312298bd909c4e7e1e688cee 100644 (file)
@@ -53,6 +53,8 @@ enum EventAction {
   EventLeaveWindow,
   EventNewWindow,
   EventCloseWindow,
+  EventStartup,
+  EventShutdown,
   NUM_EVENTS
 };
 
index 657705565893fa6c0e89bdb3dcb524ef2e405993..f9485595f5ef22df21f8b876cbb73899f14af9a4 100644 (file)
@@ -138,6 +138,11 @@ OBScreen::OBScreen(int screen)
 
   // register this class as the event handler for the root window
   Openbox::instance->registerHandler(_info->rootWindow(), this);
+
+  // call the python Startup callbacks
+  EventData *data = new_event_data(_number, 0, EventShutdown, 0);
+  Openbox::instance->bindings()->fireEvent(data);
+  Py_XDECREF((PyObject*)data);
 }
 
 
@@ -151,6 +156,11 @@ OBScreen::~OBScreen()
   while (!clients.empty())
     unmanageWindow(clients.front());
 
+  // call the python Shutdown callbacks
+  EventData *data = new_event_data(_number, 0, EventShutdown, 0);
+  Openbox::instance->bindings()->fireEvent(data);
+  Py_XDECREF((PyObject*)data);
+
   XDestroyWindow(otk::OBDisplay::display, _focuswindow);
   XDestroyWindow(otk::OBDisplay::display, _supportwindow);
 
This page took 0.023281 seconds and 4 git commands to generate.