]> Dogcows Code - chaz/openbox/blobdiff - src/client.cc
let you optionally avoid focusing windows which have specified to not be displayed...
[chaz/openbox] / src / client.cc
index 82a2d5e200b07f92e16fa68a09364c25b3c572d4..d2a75b6a4d0a152867aeca5d154cf973685c3ff7 100644 (file)
@@ -309,6 +309,10 @@ void Client::setupDecorAndFunctions()
   if (_disabled_decorations & Decor_Close)
     _decorations &= ~Decor_Close;
 
+  // You can't shade without a titlebar
+  if (!(_decorations & Decor_Titlebar))
+    _functions &= ~Func_Shade;
+  
   changeAllowedActions();
 
   if (frame) {
@@ -889,6 +893,7 @@ void Client::setState(StateAction action, long data1, long data2)
   if (shadestate != _shaded)
     shade(shadestate);
   calcLayer();
+  changeState(); // change the hint to relect these changes
 }
 
 
@@ -899,7 +904,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:
@@ -948,7 +954,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);
 }
@@ -1142,15 +1149,23 @@ void Client::internal_move(int x, int y)
     event.xconfigure.display = **otk::display;
     event.xconfigure.event = _window;
     event.xconfigure.window = _window;
-    event.xconfigure.x = x;
-    event.xconfigure.y = y;
+    
+    // root window coords with border in mind
+    event.xconfigure.x = x - _border_width + frame->size().left;
+    event.xconfigure.y = y - _border_width + frame->size().top;
+    
     event.xconfigure.width = _area.width();
     event.xconfigure.height = _area.height();
     event.xconfigure.border_width = _border_width;
-    event.xconfigure.above = frame->window();
+    event.xconfigure.above = frame->plate();
     event.xconfigure.override_redirect = False;
     XSendEvent(event.xconfigure.display, event.xconfigure.window, False,
                StructureNotifyMask, &event);
+#if 0//def DEBUG
+    printf("Sent synthetic ConfigureNotify %d,%d %d,%d to 0x%lx\n",
+           event.xconfigure.x, event.xconfigure.y, event.xconfigure.width,
+           event.xconfigure.height, event.xconfigure.window);
+#endif
   }
 }
 
This page took 0.023698 seconds and 4 git commands to generate.