summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2013-08-21 10:36:19 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-08-21 16:39:55 +0200
commitbc4ce284ade4e3584370a74a0cc6aadc40301231 (patch)
tree0ef905dbcac1081582c0d3be7d994453ec72fe38 /src/plugins/platforms
parent8074693425e06d2c4a8f130124658fe72f3e5ab9 (diff)
Windows: Generate expose events for layered transient children.
Layered (translucent/non-opaque) windows do not receive WM_PAINT, expose events need to be generated. Improve 6800728d091e5122e6d93675db84ee028221d161 to handle transient children as well. Task-number: QTBUG-17548 Change-Id: Id113604512692dfbea1f2b10d0db3068213cf599 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp25
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.h10
2 files changed, 29 insertions, 6 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 8ec10294a2..401fa67c4b 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -1408,14 +1408,27 @@ void QWindowsWindow::handleWindowStateChange(Qt::WindowState state)
handleHidden();
QWindowSystemInterface::flushWindowSystemEvents(); // Tell QQuickWindow to stop rendering now.
break;
- case Qt::WindowNoState:
+ 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();
+ // layered windows and transient children, we won't receive any WM_Paint.
+ QWindow *w = window();
+ bool exposeEventsSent = false;
+ if (isLayered()) {
+ fireExpose(QRegion(0, 0, w->width(), w->height()));
+ exposeEventsSent = true;
}
+ foreach (QWindow *child, QGuiApplication::allWindows()) {
+ if (child != w && child->isVisible() && child->transientParent() == w) {
+ QWindowsWindow *platformWindow = QWindowsWindow::baseWindowOf(child);
+ if (platformWindow->isLayered()) {
+ platformWindow->fireExpose(QRegion(0, 0, child->width(), child->height()));
+ exposeEventsSent = true;
+ }
+ }
+ }
+ if (exposeEventsSent && !QWindowsContext::instance()->asyncExpose())
+ QWindowSystemInterface::flushWindowSystemEvents();
+ }
break;
default:
break;
diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h
index f7d142fc36..afcfa8b821 100644
--- a/src/plugins/platforms/windows/qwindowswindow.h
+++ b/src/plugins/platforms/windows/qwindowswindow.h
@@ -229,6 +229,7 @@ public:
static inline void setUserDataOf(HWND hwnd, void *ud);
static bool setWindowLayered(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, qreal opacity);
+ bool isLayered() const;
HDC getDC();
void releaseDC();
@@ -375,6 +376,15 @@ inline void QWindowsWindow::destroyIcon()
}
}
+inline bool QWindowsWindow::isLayered() const
+{
+#ifndef Q_OS_WINCE
+ return GetWindowLongPtr(m_data.hwnd, GWL_EXSTYLE) & WS_EX_LAYERED;
+#else
+ return false;
+#endif
+}
+
QT_END_NAMESPACE
Q_DECLARE_METATYPE(QMargins)