]> Dogcows Code - chaz/openbox/blobdiff - src/Slit.cc
proper order for the stacking order list
[chaz/openbox] / src / Slit.cc
index 83923dfcb43d8278dbd4cc3387ee389b72d5461d..171432af9b2be2be84509313c6c40c807a8553cf 100644 (file)
@@ -433,25 +433,29 @@ void Slit::updateStrut(void) {
   strut.top = strut.bottom = strut.left = strut.right = 0;
 
   if (! clientList.empty()) {
+    // when not hidden both borders are in use, when hidden only one is
+    unsigned int border_width = screen->getBorderWidth();
+    if (! do_auto_hide)
+      border_width *= 2;
+
     switch (direction) {
     case Vertical:
       switch (placement) {
       case TopCenter:
-        strut.top = getY() + getExposedHeight() +
-                    (screen->getBorderWidth() * 2);
+        strut.top = getExposedHeight() + border_width;
         break;
       case BottomCenter:
-        strut.bottom = screen->getHeight() - getY();
+        strut.bottom = getExposedHeight() + border_width;
         break;
       case TopLeft:
       case CenterLeft:
       case BottomLeft:
-        strut.left = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.left = getExposedWidth() + border_width;
         break;
       case TopRight:
       case CenterRight:
       case BottomRight:
-        strut.right = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.right = getExposedWidth() + border_width;
         break;
       }
       break;
@@ -460,19 +464,18 @@ void Slit::updateStrut(void) {
       case TopCenter:
       case TopLeft:
       case TopRight:
-        strut.top = getY() + getExposedHeight() +
-                    (screen->getBorderWidth() * 2);
+        strut.top = getExposedHeight() + border_width;
         break;
       case BottomCenter:
       case BottomLeft:
       case BottomRight:
-        strut.bottom = screen->getHeight() - getY();
+        strut.bottom = getExposedHeight() + border_width;
         break;
       case CenterLeft:
-        strut.left = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.left = getExposedWidth() + border_width;
         break;
       case CenterRight:
-        strut.right = getExposedWidth() + (screen->getBorderWidth() * 2);
+        strut.right = getExposedWidth() + border_width;
         break;
       }
       break;
This page took 0.021682 seconds and 4 git commands to generate.