summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.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/windows/qwindowswindow.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/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp28
1 files changed, 3 insertions, 25 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 7d0b00b312..51497b3300 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1376,25 +1376,6 @@ void QWindowsWindow::handleResized(int wParam)
}
}
-// Return the effective screen for full screen mode in a virtual desktop.
-static QScreen *effectiveScreen(const QWindow *w)
-{
- QRect geometry = w->geometry();
- if (!w->isTopLevel())
- geometry.moveTopLeft(w->mapToGlobal(geometry.topLeft()));
-
- QScreen *screen = w->screen();
- if (!screen->geometry().intersects(geometry)) {
- foreach (QScreen *sibling, screen->virtualSiblings()) {
- if (sibling->geometry().intersects(geometry)) {
- screen = sibling;
- break;
- }
- }
- }
- return screen;
-}
-
void QWindowsWindow::handleGeometryChange()
{
//Prevent recursive resizes for Windows CE
@@ -1411,12 +1392,9 @@ void QWindowsWindow::handleGeometryChange()
fireExpose(QRegion(m_data.geometry), true);
}
if (previousGeometry.topLeft() != m_data.geometry.topLeft()) {
- QWindow *w = window();
- if (w->isTopLevel()) {
- QScreen *newScreen = effectiveScreen(w);
- if (newScreen != w->screen())
- QWindowSystemInterface::handleWindowScreenChanged(w, newScreen);
- }
+ QPlatformScreen *newScreen = screenForGeometry(m_data.geometry);
+ if (newScreen != screen())
+ QWindowSystemInterface::handleWindowScreenChanged(window(), newScreen->screen());
}
if (testFlag(SynchronousGeometryChangeEvent))
QWindowSystemInterface::flushWindowSystemEvents();