diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.cpp | 20 | ||||
-rw-r--r-- | src/plugins/platforms/windows/qwindowswindow.h | 2 |
2 files changed, 21 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp index cf22783c286..22277af52bb 100644 --- a/src/plugins/platforms/windows/qwindowswindow.cpp +++ b/src/plugins/platforms/windows/qwindowswindow.cpp @@ -1402,6 +1402,24 @@ void QWindowsBaseWindow::setCustomMargins(const QMargins &) Q_UNIMPLEMENTED(); } +bool QWindowsBaseWindow::windowEvent(QEvent *event) +{ + switch (event->type()) { + case QEvent::ChildWindowAdded: + if (!(GetWindowLongPtr(handle(), GWL_STYLE) & WS_CLIPCHILDREN)) { + auto *childWindowEvent = static_cast<QChildWindowEvent*>(event); + qWarning() << childWindowEvent->child() << "added as child to" + << window() << "which does not have WS_CLIPCHILDREN set." + << "This will result in drawing artifacts!"; + } + break; + default: + break; + } + + return QPlatformWindow::windowEvent(event); +} + /*! \class QWindowsDesktopWindow \brief Window wrapping GetDesktopWindow not allowing any manipulation. @@ -2928,7 +2946,7 @@ bool QWindowsWindow::windowEvent(QEvent *event) break; } - return QPlatformWindow::windowEvent(event); + return QWindowsBaseWindow::windowEvent(event); } void QWindowsWindow::propagateSizeHints() diff --git a/src/plugins/platforms/windows/qwindowswindow.h b/src/plugins/platforms/windows/qwindowswindow.h index 7805530681a..a384b4b1c7a 100644 --- a/src/plugins/platforms/windows/qwindowswindow.h +++ b/src/plugins/platforms/windows/qwindowswindow.h @@ -126,6 +126,8 @@ public: static QWindowsBaseWindow *baseWindowOf(const QWindow *w); static HWND handleOf(const QWindow *w); + bool windowEvent(QEvent *event) override; + protected: HWND parentHwnd() const { return GetAncestor(handle(), GA_PARENT); } bool isTopLevel_sys() const; |