diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2012-10-23 16:25:47 +0300 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-10-25 14:10:04 +0200 |
commit | c4109fe10370b7b27b22ddc9db4286db34ea9c4e (patch) | |
tree | 05d0d9880cb703e41d5068383ac07eb68d86b108 /src/plugins/platforms/windows/qwindowsintegration.cpp | |
parent | 52ccbd8911f1b96b8bea6a4c9da4d4a762dee2a7 (diff) |
Fix crash when handling WM_PAINT during COM operations
Synchronous expose corrupts painter state if it is done during existing
paint operation, which can happen e.g. when requesting some value from
dumpcpp generated wrapper inside a slot.
Fixed by implementing support for setting asynchronous expose and
doing expose according to the setting in handleWmPaint().
Task-number: QTBUG-27209
Change-Id: I89b5aa823fda947d26b1a4757f129e7c31ea408b
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowsintegration.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowsintegration.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/platforms/windows/qwindowsintegration.cpp b/src/plugins/platforms/windows/qwindowsintegration.cpp index f95fbf4b34..b7309c3f7c 100644 --- a/src/plugins/platforms/windows/qwindowsintegration.cpp +++ b/src/plugins/platforms/windows/qwindowsintegration.cpp @@ -96,6 +96,7 @@ QT_BEGIN_NAMESPACE class QWindowsNativeInterface : public QPlatformNativeInterface { Q_OBJECT + Q_PROPERTY(bool asyncExpose READ asyncExpose WRITE setAsyncExpose) public: #ifndef QT_NO_OPENGL virtual void *nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context); @@ -106,6 +107,8 @@ public: Q_INVOKABLE void *createMessageWindow(const QString &classNameTemplate, const QString &windowName, void *eventProc) const; + bool asyncExpose() const; + void setAsyncExpose(bool value); }; void *QWindowsNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window) @@ -183,6 +186,16 @@ void *QWindowsNativeInterface::createMessageWindow(const QString &classNameTempl return hwnd; } +bool QWindowsNativeInterface::asyncExpose() const +{ + return QWindowsContext::instance()->asyncExpose(); +} + +void QWindowsNativeInterface::setAsyncExpose(bool value) +{ + QWindowsContext::instance()->setAsyncExpose(value); +} + /*! \class QWindowsIntegration \brief QPlatformIntegration implementation for Windows. |