]> Dogcows Code - chaz/openbox/commitdiff
posible fix for maximizing when slit is auto-hidden
authorDana Jansens <danakj@orodu.net>
Mon, 22 Apr 2002 18:59:04 +0000 (18:59 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 22 Apr 2002 18:59:04 +0000 (18:59 +0000)
src/Slit.h
src/Window.cc

index f7feb6b16560a76b05e3f97ef27077f7698585b2..89d76dafa36ab1e62e4898873c5d5e0353975065 100644 (file)
@@ -133,6 +133,7 @@ public:
   inline const Point &origin() const { return frame.area.origin(); }
   inline const Size &size() const { return frame.area.size(); }
   inline const Rect &area() const { return frame.area; }
+  inline const Point &hiddenOrigin() const { return frame.hidden; }
 
   void addClient(Window);
   void removeClient(SlitClient *, Bool = True);
index 73291228293f2ed3b9b94bc4f2598c9a0930736a..6a057a75d75c67d16ced15c2d977e4705a133e6d 100644 (file)
@@ -1539,6 +1539,8 @@ void OpenboxWindow::maximize(unsigned int button) {
   if (! screen->fullMax()) {
 #ifdef    SLIT
     Slit *slit = screen->getSlit();
+    int slit_x = slit->autoHide() ? slit->hiddenOrigin().x() : slit->area().x(),
+        slit_y = slit->autoHide() ? slit->hiddenOrigin().y() : slit->area().y();
     Toolbar *toolbar = screen->getToolbar();
     int tbarh = screen->hideToolbar() ? 0 :
       toolbar->getExposedHeight() + screen->getBorderWidth() * 2;
@@ -1562,19 +1564,21 @@ void OpenboxWindow::maximize(unsigned int button) {
           slit->placement() == Slit::TopRight)) ||
         slit->placement() == Slit::TopCenter) {
       // exclude top
-      if (tbartop) {
-        space.setY(slit->area().y());
-        space.setH(space.h() - space.y());
-      } else
+      if (tbartop)
+        space.setH(space.h() - slit_y);
+      else
         space.setH(space.h() - tbarh);
-      space.setY(space.y() + slit->area().h() + screen->getBorderWidth() * 2);
-      space.setH(space.h() - (slit->area().h() + screen->getBorderWidth() * 2));
+      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 if ((slit->direction() == Slit::Vertical &&
               (slit->placement() == Slit::TopRight ||
                slit->placement() == Slit::BottomRight)) ||
              slit->placement() == Slit::CenterRight) {
       // exclude right
-      space.setW(space.w() - (slit->area().w() + screen->getBorderWidth() * 2));
+      space.setW(space.w() - (screen->size().w() - slit_x +
+                              screen->getBorderWidth() * 2));
       if (tbartop)
         space.setY(space.y() + tbarh);
       space.setH(space.h() - tbarh);
@@ -1583,14 +1587,16 @@ void OpenboxWindow::maximize(unsigned int button) {
                slit->placement() == Slit::BottomRight)) ||
              slit->placement() == Slit::BottomCenter) {
       // exclude bottom
-      space.setH(space.h() - (screen->size().h() - slit->area().y()));
+      space.setH(space.h() - (screen->size().h() - slit_y));
     } else {// if ((slit->direction() == Slit::Vertical &&
       //      (slit->placement() == Slit::TopLeft ||
       //       slit->placement() == Slit::BottomLeft)) ||
       //     slit->placement() == Slit::CenterLeft)
       // exclude left
-      space.setX(slit->area().w() + screen->getBorderWidth() * 2);
-      space.setW(space.w() - (slit->area().w() + screen->getBorderWidth() * 2));
+      space.setX(slit_x + slit->area().w() +
+                 screen->getBorderWidth() * 2);
+      space.setW(space.w() - (slit_x + slit->area().w() +
+                              screen->getBorderWidth() * 2));
       if (tbartop)
         space.setY(space.y() + tbarh);
       space.setH(space.h() - tbarh);
This page took 0.025094 seconds and 4 git commands to generate.