summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbwindow.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-07-04 10:39:19 +0200
committerFriedemann Kleint <Friedemann.Kleint@digia.com>2014-07-07 13:08:46 +0200
commit3f60bd305ad3b094356750c21e253704bbe62681 (patch)
tree27e3a6b3e686482326913a5e8ed0347049b06906 /src/plugins/platforms/xcb/qxcbwindow.cpp
parent16baadab11341e671150932fd28cff466a4fc041 (diff)
Add convenience function for checking screen changes to QPlatformWindow.
Add function returning the screen for a new geometry for geometry change events. This ensures that the checking is done in platform screen coordinates (which might differ from QScreen coordinates due to high-DPI changes) and also that no screen changes are emitted for child windows. Change-Id: I406750f59f006f834c386d09c0c85a804014924a Reviewed-by: Jørgen Lind <jorgen.lind@digia.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbwindow.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/plugins/platforms/xcb/qxcbwindow.cpp b/src/plugins/platforms/xcb/qxcbwindow.cpp
index 0cc8c8dbfe..578b4d6ec1 100644
--- a/src/plugins/platforms/xcb/qxcbwindow.cpp
+++ b/src/plugins/platforms/xcb/qxcbwindow.cpp
@@ -1842,14 +1842,10 @@ void QXcbWindow::handleConfigureNotifyEvent(const xcb_configure_notify_event_t *
QPlatformWindow::setGeometry(rect);
QWindowSystemInterface::handleGeometryChange(window(), rect);
- if (!m_screen->availableGeometry().intersects(rect)) {
- Q_FOREACH (QPlatformScreen* screen, m_screen->virtualSiblings()) {
- if (screen->availableGeometry().intersects(rect)) {
- m_screen = static_cast<QXcbScreen*>(screen);
- QWindowSystemInterface::handleWindowScreenChanged(window(), m_screen->QPlatformScreen::screen());
- break;
- }
- }
+ QPlatformScreen *newScreen = screenForGeometry(rect);
+ if (newScreen != m_screen) {
+ m_screen = static_cast<QXcbScreen*>(newScreen);
+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
}
m_configureNotifyPending = false;