add startup and shutdown callback events for each screen
This commit is contained in:
parent
66921633e5
commit
26bef30a57
2 changed files with 12 additions and 0 deletions
|
@ -53,6 +53,8 @@ enum EventAction {
|
|||
EventLeaveWindow,
|
||||
EventNewWindow,
|
||||
EventCloseWindow,
|
||||
EventStartup,
|
||||
EventShutdown,
|
||||
NUM_EVENTS
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue