add startup and shutdown callback events for each screen

This commit is contained in:
Dana Jansens 2003-01-07 02:43:56 +00:00
parent 66921633e5
commit 26bef30a57
2 changed files with 12 additions and 0 deletions

View file

@ -53,6 +53,8 @@ enum EventAction {
EventLeaveWindow,
EventNewWindow,
EventCloseWindow,
EventStartup,
EventShutdown,
NUM_EVENTS
};

View 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);