diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-07-04 10:39:19 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-07-07 13:08:46 +0200 |
commit | 3f60bd305ad3b094356750c21e253704bbe62681 (patch) | |
tree | 27e3a6b3e686482326913a5e8ed0347049b06906 /src/plugins/platforms/xcb/qxcbwindow.cpp | |
parent | 16baadab11341e671150932fd28cff466a4fc041 (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.cpp | 12 |
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; |