summaryrefslogtreecommitdiff
path: root/src/staticswitcher.cpp
diff options
context:
space:
mode:
authorSam Spilsbury <SmSpillaz@gmail.com>2010-05-12 23:52:03 +0800
committerSam Spilsbury <SmSpillaz@gmail.com>2010-05-12 23:52:03 +0800
commitecf66af7bd37f0d11db05bdf8c22e6904ddb6f92 (patch)
treef2895d8137b1164b1c0f2a52908842a7dfc325c9 /src/staticswitcher.cpp
parent4d6767448511b9f02f7113fa427d31a51ac6963d (diff)
downloadstaticswitcher-ecf66af7bd37f0d11db05bdf8c22e6904ddb6f92.tar.gz
staticswitcher-ecf66af7bd37f0d11db05bdf8c22e6904ddb6f92.tar.bz2
Use configureXWindow and XConfigureWindow
::resize and XMoveResizeWindow configure the window incorrectly which results in weird display artifacts
Diffstat (limited to 'src/staticswitcher.cpp')
-rw-r--r--src/staticswitcher.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/staticswitcher.cpp b/src/staticswitcher.cpp
index b6c5303..d03d78a 100644
--- a/src/staticswitcher.cpp
+++ b/src/staticswitcher.cpp
@@ -93,13 +93,21 @@ StaticSwitchScreen::updatePopupWindow ()
CompWindow *popup = screen->findWindow (popupWindow);
+ XWindowChanges xwc;
+ unsigned int valueMask;
+
+ valueMask |= (CWX | CWY | CWWidth | CWHeight);
+
+ xwc.x = x - winWidth / 2;
+ xwc.y = y - winHeight / 2;
+ xwc.width = winWidth;
+ xwc.height = winHeight;
+
if (popup)
- popup->resize (x - winWidth / 2, y - winHeight / 2,
- winWidth, winHeight);
+ popup->configureXWindow (valueMask, &xwc);
else
- XMoveResizeWindow (::screen->dpy (), popupWindow,
- x - winWidth / 2, y - winHeight / 2,
- (unsigned)winWidth, (unsigned)winHeight);
+ XConfigureWindow (::screen->dpy (), popupWindow,
+ valueMask, &xwc);
}
void