]> Dogcows Code - chaz/openbox/blobdiff - src/Window.cc
when Image Dither is changed in the menu, make ob reconfigure so it uses the dithering
[chaz/openbox] / src / Window.cc
index 6a057a75d75c67d16ced15c2d977e4705a133e6d..f768f6c15e90ad088401ce6071e1b7055c04535d 100644 (file)
@@ -1564,21 +1564,23 @@ void OpenboxWindow::maximize(unsigned int button) {
           slit->placement() == Slit::TopRight)) ||
         slit->placement() == Slit::TopCenter) {
       // exclude top
-      if (tbartop)
-        space.setH(space.h() - slit_y);
-      else
+      if (tbartop && slit_y + slit->area().h() < tbarh) {
+        space.setY(space.y() + tbarh);
         space.setH(space.h() - tbarh);
-      space.setY(space.y() + slit_y + slit->area().h() +
-                 screen->getBorderWidth() * 2);
-      space.setH(space.h() - (slit_y + slit->area().h() +
-                              screen->getBorderWidth() * 2));
+      } else {
+        space.setY(space.y() + (slit_y + slit->area().h() +
+                                screen->getBorderWidth() * 2));
+        space.setH(space.h() - (slit_y + slit->area().h() +
+                                screen->getBorderWidth() * 2));
+        if (!tbartop)
+          space.setH(space.h() - tbarh);
+      }
     } else if ((slit->direction() == Slit::Vertical &&
               (slit->placement() == Slit::TopRight ||
                slit->placement() == Slit::BottomRight)) ||
              slit->placement() == Slit::CenterRight) {
       // exclude right
-      space.setW(space.w() - (screen->size().w() - slit_x +
-                              screen->getBorderWidth() * 2));
+      space.setW(space.w() - (screen->size().w() - slit_x));
       if (tbartop)
         space.setY(space.y() + tbarh);
       space.setH(space.h() - tbarh);
@@ -1587,7 +1589,15 @@ void OpenboxWindow::maximize(unsigned int button) {
                slit->placement() == Slit::BottomRight)) ||
              slit->placement() == Slit::BottomCenter) {
       // exclude bottom
-      space.setH(space.h() - (screen->size().h() - slit_y));
+      if (!tbartop && (screen->size().h() - slit_y) < tbarh) {
+        space.setH(space.h() - tbarh);
+      } else {
+        space.setH(space.h() - (screen->size().h() - slit_y));
+        if (tbartop) {
+          space.setY(space.y() + tbarh);
+          space.setH(space.h() - tbarh);
+        }
+      }
     } else {// if ((slit->direction() == Slit::Vertical &&
       //      (slit->placement() == Slit::TopLeft ||
       //       slit->placement() == Slit::BottomLeft)) ||
This page took 0.021049 seconds and 4 git commands to generate.