From: Dana Jansens Date: Tue, 7 Jan 2003 02:43:56 +0000 (+0000) Subject: add startup and shutdown callback events for each screen X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=26bef30a57e0a23be2dc3dd5418f305c43684bb1;p=chaz%2Fopenbox add startup and shutdown callback events for each screen --- diff --git a/src/python.hh b/src/python.hh index 948e9a72..2f779321 100644 --- a/src/python.hh +++ b/src/python.hh @@ -53,6 +53,8 @@ enum EventAction { EventLeaveWindow, EventNewWindow, EventCloseWindow, + EventStartup, + EventShutdown, NUM_EVENTS }; diff --git a/src/screen.cc b/src/screen.cc index 65770556..f9485595 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -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);