]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
don't place the window magically if we're starting (the window was already placed)
[chaz/openbox] / src / screen.cc
index 7f15b243a4a2d62a246ff75368ac7a2a4b3c7a67..2dcc110f5b668381ec791716af77f2dbf0833a31 100644 (file)
@@ -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
@@ -556,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());
@@ -592,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
@@ -655,7 +661,8 @@ void OBScreen::changeDesktop(long desktop)
   }
 
   // force the callbacks to fire
-  Openbox::instance->setFocusedClient(0);
+  if (!Openbox::instance->focusedClient())
+    Openbox::instance->setFocusedClient(0);
 }
 
 void OBScreen::changeNumDesktops(long num)
This page took 0.022125 seconds and 4 git commands to generate.