summaryrefslogtreecommitdiff
path: root/src/screen.cc
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-01-03 20:10:25 +0000
committerDana Jansens <danakj@orodu.net>2003-01-03 20:10:25 +0000
commit86a2bed6595cdc926dccb4a7c0f984fd5996e3c2 (patch)
tree46e234d4acc477d3b26b36b2d2a55b081a41264d /src/screen.cc
parent4a07868e794c5e0974d15e89579b53d598273426 (diff)
remove the block on shutdown
Diffstat (limited to 'src/screen.cc')
-rw-r--r--src/screen.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/screen.cc b/src/screen.cc
index 419ba0b9..6a9473e4 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -123,14 +123,13 @@ OBScreen::~OBScreen()
if (! _managed) return;
XSelectInput(otk::OBDisplay::display, _info->rootWindow(), NoEventMask);
- XSync(otk::OBDisplay::display, False);
- XDestroyWindow(otk::OBDisplay::display, _focuswindow);
-
// unmanage all windows
while (!clients.empty())
unmanageWindow(clients.front());
+ XDestroyWindow(otk::OBDisplay::display, _focuswindow);
+
delete _image_control;
}
@@ -425,7 +424,17 @@ void OBScreen::unmanageWindow(OBClient *client)
Openbox::instance->bindings()->grabButtons(false, client);
- // XXX: pass around focus if this window was focused
+ // remove from the stacking order
+ _stacking.remove(client);
+
+ // pass around focus if this window was focused XXX do this better!
+ if (Openbox::instance->focusedClient() == client) {
+ OBClient *newfocus = 0;
+ if (!_stacking.empty())
+ newfocus = _stacking.front();
+ if (! (newfocus && newfocus->focus()))
+ client->unfocus();
+ }
// remove from the wm's map
Openbox::instance->removeClient(client->window());
@@ -457,8 +466,7 @@ void OBScreen::unmanageWindow(OBClient *client)
delete client->frame;
client->frame = 0;
- // remove from the screen's lists
- _stacking.remove(client);
+ // remove from the screen's list
clients.remove(client);
delete client;