don't move the client if it isnt going anywhere
authorDana Jansens <danakj@orodu.net>
Thu, 30 Jan 2003 21:51:50 +0000 (21:51 +0000)
committerDana Jansens <danakj@orodu.net>
Thu, 30 Jan 2003 21:51:50 +0000 (21:51 +0000)
src/client.cc

index 8e00198a117dfb397bdf576a7195bd92e8d77489..d25d458ef920a1e391b3bc1caa100c19799ecd2f 100644 (file)
@@ -903,7 +903,8 @@ void Client::toggleClientBorder(bool addborder)
   // different position.
   // when re-adding the border to the client, the same operation needs to be
   // reversed.
-  int x = _area.x(), y = _area.y();
+  int oldx = _area.x(), oldy = _area.y();
+  int x = oldx, y = oldy;
   switch(_gravity) {
   default:
   case NorthWestGravity:
@@ -952,7 +953,8 @@ void Client::toggleClientBorder(bool addborder)
     XSetWindowBorderWidth(**otk::display, _window, _border_width);
 
     // move the client so it is back it the right spot _with_ its border!
-    XMoveWindow(**otk::display, _window, x, y);
+    if (x != oldx || y != oldy)
+      XMoveWindow(**otk::display, _window, x, y);
   } else
     XSetWindowBorderWidth(**otk::display, _window, 0);
 }