summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-03-24 07:37:43 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-03-24 07:38:02 +0100
commit135ebe4f3d268121047fdbfee49f2dd52006165e (patch)
tree6b303103f36e69e29cfa860b8b7afc584c55d6f3 /src/plugins/platforms/xcb/qxcbwindow.cpp
parente7feb956280105113b3e58f12e5f32f54199a95a (diff)
parent1e8f50a8d069c97ea6a4f00d664c12e594884f54 (diff)
Merge remote-tracking branch 'origin/5.5' into dev
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 0dde679a7a..eabebffdab 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -319,6 +319,12 @@ void QXcbWindow::create()
// currently no way to implement it for frame-exclusive geometries.
QRect rect = window()->geometry();
QPlatformWindow::setGeometry(rect);
+ QXcbScreen *currentScreen = xcbScreen();
+ QPlatformScreen *newScreen = screenForGeometry(rect);
+
+ if (newScreen != currentScreen)
+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
+
const int dpr = int(devicePixelRatio());
QSize minimumSize = window()->minimumSize();
@@ -583,9 +589,18 @@ void QXcbWindow::setGeometry(const QRect &rect)
propagateSizeHints();
- const QRect xRect = mapToNative(rect, int(devicePixelRatio()));
+ QXcbScreen *currentScreen = xcbScreen();
+ QPlatformScreen *newScreen = screenForGeometry(rect);
+ if (!newScreen)
+ newScreen = currentScreen;
+
+ const QRect xRect = mapToNative(rect, int(newScreen->devicePixelRatio()));
const QRect wmGeometry = windowToWmGeometry(xRect);
+
+ if (newScreen != currentScreen)
+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
+
if (qt_window_private(window())->positionAutomatic) {
const quint32 mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT;
const qint32 values[] = {
@@ -1919,7 +1934,7 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
if (newScreen != screen()) {
if (newScreen)
QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
- int newDpr = devicePixelRatio();
+ int newDpr = newScreen->devicePixelRatio();
if (newDpr != dpr) {
QRect newRect = mapGeometryFromNative(nativeRect, newDpr);
QPlatformWindow::setGeometry(newRect);