]> Dogcows Code - chaz/openbox/commitdiff
xinerama support for maximizing windows
authorDana Jansens <danakj@orodu.net>
Mon, 22 Jul 2002 04:56:25 +0000 (04:56 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 22 Jul 2002 04:56:25 +0000 (04:56 +0000)
src/Window.cc

index 316bbf1ae4127918743994b8e1d47f6e8c2632c2..85144ffdae54da8bb00c00e1acd12bf4c82c2082 100644 (file)
@@ -1792,8 +1792,21 @@ void BlackboxWindow::maximize(unsigned int button) {
   blackbox_attrib.premax_h =
     client.rect.height() + frame.margin.top + frame.margin.bottom;
 
-  const Rect &screen_area = screen->availableArea();
-  frame.changing = screen_area;
+#ifdef    XINERAMA
+  if (screen->isXineramaActive() && blackbox->doXineramaMaximizing()) {
+    // find the area to use
+    RectList availableAreas = screen->allAvailableAreas();
+    RectList::iterator it, end = availableAreas.end();
+
+    for (it = availableAreas.begin(); it != end; ++it)
+      if (it->intersects(frame.rect)) break;
+    if (it == end) // the window isn't inside an area
+      it = availableAreas.begin(); // so just default to the first one
+
+    frame.changing = *it;
+  } else
+#endif
+  frame.changing = screen->availableArea();
 
   switch(button) {
   case 1:
This page took 0.026664 seconds and 4 git commands to generate.