{
_state = State_Exiting; // time to kill everything
- // return input focus to the root
- XSetInputFocus(otk::OBDisplay::display, PointerRoot, None, CurrentTime);
-
std::for_each(_screens.begin(), _screens.end(), otk::PointerAssassin());
delete _bindings;
python_destroy();
- XSync(otk::OBDisplay::display, False);
-
- // close the X display
- otk::OBDisplay::destroy();
- printf("Exiting!\n");
+ XSetInputFocus(otk::OBDisplay::display, PointerRoot, RevertToNone,
+ CurrentTime);
+ XSync(otk::OBDisplay::display, false);
+
+ // this tends to block.. i honestly am not sure why. causing an x error in
+ // the shutdown process unblocks it. blackbox simply did a ::exit(0), so
+ // all im gunna do is the same.
+ //otk::OBDisplay::destroy();
}
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;
}
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());
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;