]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
test for borders on static grav windows
[chaz/openbox] / src / client.cc
index f564786f24cc0d26b8a1c530151e7ac5d92c8065..df136bf29a586cf5a3b611f051ac335e58980bc9 100644 (file)
@@ -339,7 +339,7 @@ void Client::calcLayer() {
         if we don't have a frame, then we aren't mapped yet (and this would
         SIGSEGV :)
       */
-      openbox->screen(_screen)->restack(true, this); // raise
+      openbox->screen(_screen)->raiseWindow(this);
     }
   }
 }
@@ -756,9 +756,13 @@ void Client::toggleClientBorder(bool addborder)
   // reversed.
   int x = _area.x(), y = _area.y();
   switch(_gravity) {
+  default:
   case NorthWestGravity:
   case WestGravity:
   case SouthWestGravity:
+  case NorthGravity:
+  case CenterGravity:
+  case SouthGravity:
     break;
   case NorthEastGravity:
   case EastGravity:
@@ -766,11 +770,20 @@ void Client::toggleClientBorder(bool addborder)
     if (addborder) x -= _border_width * 2;
     else           x += _border_width * 2;
     break;
+  case ForgetGravity:
+  case StaticGravity:
+    if (addborder) x -= _border_width;
+    else           x += _border_width;
+    break;
   }
   switch(_gravity) {
+  default:
   case NorthWestGravity:
+  case WestGravity:
   case NorthGravity:
+  case CenterGravity:
   case NorthEastGravity:
+  case EastGravity:
     break;
   case SouthWestGravity:
   case SouthGravity:
@@ -778,8 +791,10 @@ void Client::toggleClientBorder(bool addborder)
     if (addborder) y -= _border_width * 2;
     else           y += _border_width * 2;
     break;
-  default:
-    // no change for StaticGravity etc.
+  case ForgetGravity:
+  case StaticGravity:
+    if (addborder) y -= _border_width;
+    else           y += _border_width;
     break;
   }
   _area.setPos(x, y);
@@ -856,7 +871,7 @@ void Client::clientMessageHandler(const XClientMessageEvent &e)
       shade(false);
     // XXX: deiconify
     focus();
-    openbox->screen(_screen)->restack(true, this); // raise
+    openbox->screen(_screen)->raiseWindow(this);
   }
 }
 
@@ -1165,13 +1180,13 @@ void Client::configureRequestHandler(const XConfigureRequestEvent &e)
     switch (e.detail) {
     case Below:
     case BottomIf:
-      openbox->screen(_screen)->restack(false, this); // lower
+      openbox->screen(_screen)->lowerWindow(this);
       break;
 
     case Above:
     case TopIf:
     default:
-      openbox->screen(_screen)->restack(true, this); // raise
+      openbox->screen(_screen)->raiseWindow(this);
       break;
     }
   }
This page took 0.021915 seconds and 4 git commands to generate.