remove the block on shutdown
This commit is contained in:
parent
4a07868e79
commit
86a2bed659
4 changed files with 24 additions and 15 deletions
|
@ -162,6 +162,8 @@ line argument.\n\n"));
|
||||||
void OBDisplay::destroy()
|
void OBDisplay::destroy()
|
||||||
{
|
{
|
||||||
delete _gccache;
|
delete _gccache;
|
||||||
|
while (_grab_count > 0)
|
||||||
|
ungrab();
|
||||||
XCloseDisplay(display);
|
XCloseDisplay(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
#include "client.hh"
|
#include "client.hh"
|
||||||
#include "frame.hh"
|
#include "frame.hh"
|
||||||
#include "screen.hh"
|
#include "screen.hh"
|
||||||
#include "bbscreen.hh"
|
|
||||||
#include "openbox.hh"
|
#include "openbox.hh"
|
||||||
#include "otk/display.hh"
|
#include "otk/display.hh"
|
||||||
#include "otk/property.hh"
|
#include "otk/property.hh"
|
||||||
|
|
|
@ -172,9 +172,6 @@ Openbox::~Openbox()
|
||||||
{
|
{
|
||||||
_state = State_Exiting; // time to kill everything
|
_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());
|
std::for_each(_screens.begin(), _screens.end(), otk::PointerAssassin());
|
||||||
|
|
||||||
delete _bindings;
|
delete _bindings;
|
||||||
|
@ -183,11 +180,14 @@ Openbox::~Openbox()
|
||||||
|
|
||||||
python_destroy();
|
python_destroy();
|
||||||
|
|
||||||
XSync(otk::OBDisplay::display, False);
|
XSetInputFocus(otk::OBDisplay::display, PointerRoot, RevertToNone,
|
||||||
|
CurrentTime);
|
||||||
// close the X display
|
XSync(otk::OBDisplay::display, false);
|
||||||
otk::OBDisplay::destroy();
|
|
||||||
printf("Exiting!\n");
|
// 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,14 +123,13 @@ OBScreen::~OBScreen()
|
||||||
if (! _managed) return;
|
if (! _managed) return;
|
||||||
|
|
||||||
XSelectInput(otk::OBDisplay::display, _info->rootWindow(), NoEventMask);
|
XSelectInput(otk::OBDisplay::display, _info->rootWindow(), NoEventMask);
|
||||||
XSync(otk::OBDisplay::display, False);
|
|
||||||
|
|
||||||
XDestroyWindow(otk::OBDisplay::display, _focuswindow);
|
|
||||||
|
|
||||||
// unmanage all windows
|
// unmanage all windows
|
||||||
while (!clients.empty())
|
while (!clients.empty())
|
||||||
unmanageWindow(clients.front());
|
unmanageWindow(clients.front());
|
||||||
|
|
||||||
|
XDestroyWindow(otk::OBDisplay::display, _focuswindow);
|
||||||
|
|
||||||
delete _image_control;
|
delete _image_control;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -425,7 +424,17 @@ void OBScreen::unmanageWindow(OBClient *client)
|
||||||
|
|
||||||
Openbox::instance->bindings()->grabButtons(false, 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
|
// remove from the wm's map
|
||||||
Openbox::instance->removeClient(client->window());
|
Openbox::instance->removeClient(client->window());
|
||||||
|
@ -457,8 +466,7 @@ void OBScreen::unmanageWindow(OBClient *client)
|
||||||
delete client->frame;
|
delete client->frame;
|
||||||
client->frame = 0;
|
client->frame = 0;
|
||||||
|
|
||||||
// remove from the screen's lists
|
// remove from the screen's list
|
||||||
_stacking.remove(client);
|
|
||||||
clients.remove(client);
|
clients.remove(client);
|
||||||
delete client;
|
delete client;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue