From 7990e6fc46c4a73139cb59e2d17df37ff1fe4e0a Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 7 Jan 2003 06:50:21 +0000 Subject: [PATCH] add a PlaceWindow event hook type --- src/openbox_wrap.cc | 1 + src/python.hh | 1 + src/screen.cc | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openbox_wrap.cc b/src/openbox_wrap.cc index bf1383eb..dfa50d66 100644 --- a/src/openbox_wrap.cc +++ b/src/openbox_wrap.cc @@ -3131,6 +3131,7 @@ static swig_const_info swig_const_table[] = { { SWIG_PY_INT, (char *)"NUM_KEY_CONTEXT", (long) ob::NUM_KEY_CONTEXT, 0, 0, 0}, { SWIG_PY_INT, (char *)"EventEnterWindow", (long) ob::EventEnterWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"EventLeaveWindow", (long) ob::EventLeaveWindow, 0, 0, 0}, +{ SWIG_PY_INT, (char *)"EventPlaceWindow", (long) ob::EventPlaceWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"EventNewWindow", (long) ob::EventNewWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"EventCloseWindow", (long) ob::EventCloseWindow, 0, 0, 0}, { SWIG_PY_INT, (char *)"EventStartup", (long) ob::EventStartup, 0, 0, 0}, diff --git a/src/python.hh b/src/python.hh index 81b3b0ca..cfa625d0 100644 --- a/src/python.hh +++ b/src/python.hh @@ -52,6 +52,7 @@ enum KeyContext { enum EventAction { EventEnterWindow, EventLeaveWindow, + EventPlaceWindow, EventNewWindow, EventCloseWindow, EventStartup, diff --git a/src/screen.cc b/src/screen.cc index a403fa13..f7587abc 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -493,7 +493,11 @@ void OBScreen::manageWindow(Window window) XChangeSaveSet(otk::OBDisplay::display, window, SetModeInsert); if (!client->positionRequested()) { - // XXX: position the window intelligenty + // position the window intelligenty .. hopefully :) + // call the python PLACEWINDOW binding + EventData *data = new_event_data(_number, window, EventPlaceWindow, 0); + Openbox::instance->bindings()->fireEvent(data); + Py_DECREF((PyObject*)data); } // create the decoration frame for the client window -- 2.39.2