]> Dogcows Code - chaz/openbox/blobdiff - src/screen.cc
fix compile err
[chaz/openbox] / src / screen.cc
index e2bab5c8efa48796b3071cb03a9f0cfa56f16bcd..adcae6d9eabe9da4e8d575ffb001c0e55c46fab2 100644 (file)
@@ -134,7 +134,7 @@ Screen::Screen(int screen)
   openbox->registerHandler(_info->rootWindow(), this);
 
   // call the python Startup callbacks
-  EventData data(_number, 0, EventAction::Shutdown, 0);
+  EventData data(_number, 0, EventAction::Startup, 0);
   openbox->bindings()->fireEvent(&data);
 }
 
@@ -224,7 +224,7 @@ void Screen::updateStrut()
 
 void Screen::calcArea()
 {
-//  otk::Rect old_area = _area;
+  otk::Rect old_area = _area;
 
 /*
 #ifdef    XINERAMA
@@ -260,9 +260,13 @@ void Screen::calcArea()
   }
 #endif // XINERAMA
 */
-  
-  //if (old_area != _area)
-    // XXX: re-maximize windows
+  if (old_area != _area) {
+    // the area has changed, adjust all the maximized windows
+    Client::List::iterator it, end = clients.end();
+    for (it = clients.begin(); it != end; ++it)
+      (*it)->remaximize();
+  }
 
   changeWorkArea();
 }
@@ -512,14 +516,16 @@ void Screen::manageWindow(Window window)
   // reparent the client to the frame
   client->frame->grabClient();
 
-  if (!(openbox->state() == Openbox::State_Starting ||
-        client->positionRequested())) {
+  if (openbox->state() != Openbox::State_Starting) {
     // position the window intelligenty .. hopefully :)
     // call the python PLACEWINDOW binding
     EventData data(_number, client, EventAction::PlaceWindow, 0);
     openbox->bindings()->fireEvent(&data);
   }
 
+  EventData ddata(_number, client, EventAction::DisplayingWindow, 0);
+  openbox->bindings()->fireEvent(&ddata);
+
   // if on the current desktop.. (or all desktops)
   if (client->desktop() == _desktop ||
       client->desktop() == (signed)0xffffffff) {
@@ -532,6 +538,9 @@ void Screen::manageWindow(Window window)
 
   // add to the screen's list
   clients.push_back(client);
+  // once the client is in the list, update our strut to include the new
+  // client's (it is good that this happens after window placement!)
+  updateStrut();
   // this puts into the stacking order, then raises it
   _stacking.push_back(client);
   raiseWindow(client);
@@ -540,9 +549,8 @@ void Screen::manageWindow(Window window)
 
   openbox->bindings()->grabButtons(true, client);
 
-  // call the python NEWWINDOW binding
-  EventData data(_number, client, EventAction::NewWindow, 0);
-  openbox->bindings()->fireEvent(&data);
+  EventData ndata(_number, client, EventAction::NewWindow, 0);
+  openbox->bindings()->fireEvent(&ndata);
 
 #ifdef DEBUG
   printf("Managed window 0x%lx frame 0x%lx\n",
@@ -603,6 +611,10 @@ void Screen::unmanageWindow(Client *client)
   // remove from the screen's list
   clients.remove(client);
 
+  // once the client is out of the list, update our strut to remove it's
+  // influence
+  updateStrut();
+
   // unfocus the client (calls the focus callbacks)
   client->unfocus();
 
This page took 0.022265 seconds and 4 git commands to generate.