summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowswindow.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-04-14 11:03:32 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-04-15 09:29:56 +0200
commit4bb803477bacc70f756b1aaea9e048b2bae0fa6a (patch)
treec9cb1decf14e4a3ae416e8e1c03923f139e3f8b8 /src/plugins/platforms/windows/qwindowswindow.cpp
parent8907635da59c2ae0e8db01f27b24a841b830e655 (diff)
Windows QPA: Fix geometry when firing a full expose
There are several places in the code where a full expose event is fired, but the geometry in logical coordinates is used (pre-dating High DPI scaling). Fix by introducing a helper function for it. Task-number: QTBUG-83449 Change-Id: Ie8bb306de0b9b2b85306ed1bb6ba71181b76a958 Reviewed-by: André de la Rocha <andre.rocha@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowswindow.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 429e30728f..6b53e3d4c4 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1401,6 +1401,11 @@ void QWindowsWindow::fireExpose(const QRegion &region, bool force)
QWindowSystemInterface::handleExposeEvent(window(), region);
}
+void QWindowsWindow::fireFullExpose(bool force)
+{
+ fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), force);
+}
+
void QWindowsWindow::destroyWindow()
{
qCDebug(lcQpaWindows) << __FUNCTION__ << this << window() << m_data.hwnd;
@@ -1561,7 +1566,7 @@ void QWindowsWindow::setVisible(bool visible)
// over the rendering of the window
// There is nobody waiting for this, so we don't need to flush afterwards.
if (isLayered())
- fireExpose(QRect(0, 0, win->width(), win->height()));
+ fireFullExpose();
// QTBUG-44928, QTBUG-7386: This is to resolve the problem where popups are
// opened from the system tray and not being implicitly activated
@@ -1966,7 +1971,7 @@ void QWindowsWindow::handleGeometryChange()
&& m_data.geometry.size() != previousGeometry.size() // Exclude plain move
// One dimension grew -> Windows will send expose, no need to synthesize.
&& !(m_data.geometry.width() > previousGeometry.width() || m_data.geometry.height() > previousGeometry.height())) {
- fireExpose(QRect(QPoint(0, 0), m_data.geometry.size()), true);
+ fireFullExpose(true);
}
const bool wasSync = testFlag(SynchronousGeometryChangeEvent);
@@ -2165,7 +2170,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
QWindow *w = window();
bool exposeEventsSent = false;
if (isLayered()) {
- fireExpose(QRegion(0, 0, w->width(), w->height()));
+ fireFullExpose();
exposeEventsSent = true;
}
const QWindowList allWindows = QGuiApplication::allWindows();
@@ -2173,7 +2178,7 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowStates state)
if (child != w && child->isVisible() && child->transientParent() == w) {
QWindowsWindow *platformWindow = QWindowsWindow::windowsWindowOf(child);
if (platformWindow && platformWindow->isLayered()) {
- platformWindow->fireExpose(QRegion(0, 0, child->width(), child->height()));
+ platformWindow->fireFullExpose();
exposeEventsSent = true;
}
}