From f257e4b0792e07e11a56828d4769f618e35df105 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 10 Nov 2002 04:26:36 +0000 Subject: [PATCH] position the client inside the frame correctly. unmanage all clients on shutdown --- src/frame.cc | 2 ++ src/openbox.cc | 6 ++++++ src/xeventhandler.cc | 4 ++-- src/xeventhandler.hh | 9 +++++++++ 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/frame.cc b/src/frame.cc index 9e4a8edb..601bbe39 100644 --- a/src/frame.cc +++ b/src/frame.cc @@ -65,6 +65,8 @@ void OBFrame::resize() XResizeWindow(otk::OBDisplay::display, _window, _size.left + _size.right + _client->area().width(), _size.top + _size.bottom + _client->area().height()); + XMoveWindow(otk::OBDisplay::display, _client->window(), + _size.left, _size.top); // XXX: more is gunna have to happen here } diff --git a/src/openbox.cc b/src/openbox.cc index c5a93eeb..757a6984 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -105,6 +105,12 @@ Openbox::Openbox(int argc, char **argv) Openbox::~Openbox() { _state = State_Exiting; // time to kill everything + + // unmanage all windows + ClientMap::iterator it, end; + for (it = _clients.begin(), end = _clients.end(); it != end; ++it) { + _xeventhandler.unmanageWindow(it->second); + } // close the X display otk::OBDisplay::destroy(); diff --git a/src/xeventhandler.cc b/src/xeventhandler.cc index bdebadd8..ad7d7e27 100644 --- a/src/xeventhandler.cc +++ b/src/xeventhandler.cc @@ -124,7 +124,7 @@ void OBXEventHandler::configureRequest(const XConfigureRequestEvent &e) // XXX: put this into the OBScreen or OBClient class! -static void manageWindow(int screen, Window window) +void OBXEventHandler::manageWindow(int screen, Window window) { OBClient *client = 0; XWMHints *wmhint; @@ -177,7 +177,7 @@ static void manageWindow(int screen, Window window) } // XXX: move this to the OBScreen or OBClient class! -static void unmanageWindow(OBClient *client) +void OBXEventHandler::unmanageWindow(OBClient *client) { OBFrame *frame = client->frame; diff --git a/src/xeventhandler.hh b/src/xeventhandler.hh index 87afee3a..e46ae116 100644 --- a/src/xeventhandler.hh +++ b/src/xeventhandler.hh @@ -13,6 +13,10 @@ extern "C" { namespace ob { +// XXX: TEMPORARY!! +class OBClient; + + //! Handles X events /*! There are 2 type of X events:
@@ -142,6 +146,11 @@ public: @param e The XEvent to handle */ void handle(const XEvent &e); + + + // XXX: TEMPORARY MOVE TO A SCREEN CLASS OR SOMETHING + void manageWindow(int, Window); + void unmanageWindow(OBClient*); }; } -- 2.45.2