From 26bef30a57e0a23be2dc3dd5418f305c43684bb1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 7 Jan 2003 02:43:56 +0000 Subject: [PATCH] add startup and shutdown callback events for each screen --- src/python.hh | 2 ++ src/screen.cc | 10 ++++++++++ 2 files changed, 12 insertions(+) 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); -- 2.45.2