diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp index 4ec767afa4b..7cb00d4a0a1 100644 --- a/src/plugins/platforms/windows/qwindowscontext.cpp +++ b/src/plugins/platforms/windows/qwindowscontext.cpp @@ -1268,7 +1268,7 @@ bool QWindowsContext::windowsProc(HWND hwnd, UINT message, case QtWindows::GeometryChangingEvent: return platformWindow->QWindowsWindow::handleGeometryChanging(&msg); case QtWindows::ExposeEvent: - return platformWindow->handleWmPaint(hwnd, message, wParam, lParam); + return platformWindow->handleWmPaint(hwnd, message, wParam, lParam, result); case QtWindows::NonClientMouseEvent: if ((d->m_systemInfo & QWindowsContext::SI_SupportsPointer) && platformWindow->frameStrutEventsEnabled()) return sessionManagerInteractionBlocked() || d->m_pointerHandler.translateMouseEvent(platformWindow->window(), hwnd, et, msg, result); diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index b100015f625..d77c1ad8f06 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -2157,10 +2157,12 @@ static inline bool isSoftwareGl() } bool QWindowsWindow::handleWmPaint(HWND hwnd, UINT message, - WPARAM, LPARAM) + WPARAM, LPARAM, LRESULT *result) { - if (message == WM_ERASEBKGND) // Backing store - ignored. + if (message == WM_ERASEBKGND) { // Backing store - ignored. + *result = 1; return true; + } // QTBUG-75455: Suppress WM_PAINT sent to invisible windows when setting WS_EX_LAYERED if (!window()->isVisible() && (GetWindowLong(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) != 0) return false; diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 7123afa11a9..5e8478ca9cb 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -313,7 +313,7 @@ public: void setStyle(unsigned s) const; void setExStyle(unsigned s) const; - bool handleWmPaint(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam); + bool handleWmPaint(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam, LRESULT *result); void handleMoved(); void handleResized(int wParam);