]> Dogcows Code - chaz/openbox/commitdiff
even more fixes for maximizing/placement with hidden slit/toolbar/etc
authorDana Jansens <danakj@orodu.net>
Mon, 22 Apr 2002 23:00:57 +0000 (23:00 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 22 Apr 2002 23:00:57 +0000 (23:00 +0000)
src/Window.cc
src/Workspace.cc

index 6d9d8859baad3a97d5a235ced4e0daa8b4b13310..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,8 +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) > tbarh ?
-                              screen->size().h() - slit_y : tbarh));
+      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)) ||
index 45dc2bc303c44a1f762680e835af5b711b907656..27afcaded75d4f77df4ad7a67c016dcc7f474862 100644 (file)
@@ -572,21 +572,23 @@ void Workspace::placeWindow(OpenboxWindow *win) {
           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);
@@ -595,8 +597,15 @@ void Workspace::placeWindow(OpenboxWindow *win) {
                slit->placement() == Slit::BottomRight)) ||
              slit->placement() == Slit::BottomCenter) {
       // exclude bottom
-      space.setH(space.h() - ((screen.size().h() - slit_y) > tbarh ?
-                              screen.size().h() - slit_y : tbarh));
+      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.027217 seconds and 4 git commands to generate.