diff options
author | Sérgio Martins <sergio.martins@kdab.com> | 2013-07-01 09:46:42 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-07-02 11:05:18 +0200 |
commit | 6800728d091e5122e6d93675db84ee028221d161 (patch) | |
tree | 68354fd766d6348a5c2c22679677e71408b34f42 | |
parent | bef01c87a81d88ac2a32b87e1bb23e7c12fd4dd9 (diff) |
Windows: Fix bug where windows stopped painting after a restore.
Usually, a window get un-exposed when minimized, and exposed
after the first WM_Paint event when restored.
With layered windows (translucent+frameless) we never receive
a WM_Paint, so lets send the expose event when the window is
restired.
Task-number: QTBUG-17548
Change-Id: Ib56d8abd91b15f9238d223fe692b19a3d2c930b7
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index 08ff7123eb..9b22b68c31 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1390,9 +1390,22 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state) setFlag(FrameDirty); m_windowState = state; QWindowSystemInterface::handleWindowStateChanged(window(), state); - if (state == Qt::WindowMinimized) { + switch (state) { + case Qt::WindowMinimized: handleHidden(); QWindowSystemInterface::flushWindowSystemEvents(); // Tell QQuickWindow to stop rendering now. + break; + case Qt::WindowNoState: + // QTBUG-17548: We send expose events when receiving WM_Paint, but for + // layered windows, we won't receive any WM_Paint. + if (GetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE) & WS_EX_LAYERED) { + fireExpose(QRegion(0, 0, window()->width(), window()->height())); + if (!QWindowsContext::instance()->asyncExpose()) + QWindowSystemInterface::flushWindowSystemEvents(); + } + break; + default: + break; } } |