summaryrefslogtreecommitdiff
path: root/src/screen.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.cc')
-rw-r--r--src/screen.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/screen.cc b/src/screen.cc
index 3c364b4c..09f57d64 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -519,6 +519,9 @@ void OBScreen::manageWindow(Window window)
Openbox::instance->addClient(client->frame->grip_left(), client);
Openbox::instance->addClient(client->frame->grip_right(), client);
+ // reparent the client to the frame
+ client->frame->grabClient();
+
// if on the current desktop.. (or all desktops)
if (client->desktop() == _desktop ||
client->desktop() == (signed)0xffffffff) {
@@ -548,7 +551,7 @@ void OBScreen::manageWindow(Window window)
}
-void OBScreen::unmanageWindow(OBClient *client)
+void OBScreen::unmanageWindow(OBClient *client, bool reparented)
{
OBFrame *frame = client->frame;
@@ -587,6 +590,14 @@ void OBScreen::unmanageWindow(OBClient *client)
// give the client its border back
client->toggleClientBorder(true);
+ if (!reparented)
+ // reparent the window out of the frame
+ frame->releaseClient();
+ else
+ // the client is already reparented, so, since we unmapped the window
+ // above, we remap it here. aren't we nice? :)
+ XMapWindow(otk::OBDisplay::display, client->window());
+
delete client->frame;
client->frame = 0;