X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fscreen.cc;h=2dcc110f5b668381ec791716af77f2dbf0833a31;hb=a132968424c96d9dc62d144c5e863a6810c0369d;hp=49d63409b23de7a7240304414efd9a88107e5d44;hpb=4c768d5d63154e416e1282396dc48492d0585d42;p=chaz%2Fopenbox diff --git a/src/screen.cc b/src/screen.cc index 49d63409..2dcc110f 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -492,8 +492,13 @@ void OBScreen::manageWindow(Window window) // reparented back to root automatically XChangeSaveSet(otk::OBDisplay::display, window, SetModeInsert); - if (!client->positionRequested()) { - // XXX: position the window intelligenty + if (!(Openbox::instance->state() == Openbox::State_Starting || + client->positionRequested())) { + // position the window intelligenty .. hopefully :) + // call the python PLACEWINDOW binding + EventData *data = new_event_data(_number, window, EventPlaceWindow, 0); + Openbox::instance->bindings()->fireEvent(data); + Py_DECREF((PyObject*)data); } // create the decoration frame for the client window @@ -535,12 +540,6 @@ void OBScreen::manageWindow(Window window) Openbox::instance->bindings()->grabButtons(true, client); - if (shown) { - // XXX: make this optional or more intelligent - if (client->normal()) - client->focus(); - } - // call the python NEWWINDOW binding EventData *data = new_event_data(_number, window, EventNewWindow, 0); Openbox::instance->bindings()->fireEvent(data); @@ -562,12 +561,6 @@ void OBScreen::unmanageWindow(OBClient *client) Openbox::instance->bindings()->grabButtons(false, client); - // remove from the stacking order - _stacking.remove(client); - - // unfocus the client - client->unfocus(); - // remove from the wm's map Openbox::instance->removeClient(client->window()); Openbox::instance->removeClient(frame->window()); @@ -598,8 +591,15 @@ void OBScreen::unmanageWindow(OBClient *client) delete client->frame; client->frame = 0; + // remove from the stacking order + _stacking.remove(client); + // remove from the screen's list clients.remove(client); + + // unfocus the client (calls the focus callbacks) + client->unfocus(); + delete client; // update the root properties @@ -650,7 +650,7 @@ void OBScreen::changeDesktop(long desktop) _desktop); if (old == _desktop) return; - + OBClient::List::iterator it, end = clients.end(); for (it = clients.begin(); it != end; ++it) { if ((*it)->desktop() == old) { @@ -660,9 +660,9 @@ void OBScreen::changeDesktop(long desktop) } } - // if nothing is focused, force the callbacks to fire -// if (!Openbox::instance->focusedClient()) -// Openbox::instance->setFocusedClient(0); + // force the callbacks to fire + if (!Openbox::instance->focusedClient()) + Openbox::instance->setFocusedClient(0); } void OBScreen::changeNumDesktops(long num)