const HRESULT m_oleInitializeResult;
const QByteArray m_eventType;
QWindow *m_lastActiveWindow;
+ bool m_asyncExpose;
};
QWindowsContextPrivate::QWindowsContextPrivate() :
m_defaultDPI(GetDeviceCaps(m_displayContext,LOGPIXELSY)),
m_oleInitializeResult(OleInitialize(NULL)),
m_eventType(QByteArrayLiteral("windows_generic_MSG")),
- m_lastActiveWindow(0)
+ m_lastActiveWindow(0), m_asyncExpose(0)
{
#ifndef Q_OS_WINCE
QWindowsContext::user32dll.init();
}
#endif
+bool QWindowsContext::asyncExpose() const
+{
+ return d->m_asyncExpose;
+}
+
+void QWindowsContext::setAsyncExpose(bool value)
+{
+ d->m_asyncExpose = value;
+}
+
/*!
\brief Windows functions for actual windows.
#endif
static QByteArray comErrorString(HRESULT hr);
+ bool asyncExpose() const;
+ void setAsyncExpose(bool value);
private:
void handleFocusEvent(QtWindows::WindowsEventType et, QWindowsWindow *w);
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);
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)
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.
InvalidateRect(hwnd, 0, false);
BeginPaint(hwnd, &ps);
QWindowSystemInterface::handleExposeEvent(window(), QRegion(qrectFromRECT(ps.rcPaint)));
- QWindowSystemInterface::flushWindowSystemEvents();
+ if (!QWindowsContext::instance()->asyncExpose())
+ QWindowSystemInterface::flushWindowSystemEvents();
EndPaint(hwnd, &ps);
} else {
qDebug() << __FUNCTION__ << this << window() << updateRect;
QWindowSystemInterface::handleExposeEvent(window(), QRegion(updateRect));
- QWindowSystemInterface::flushWindowSystemEvents();
+ if (!QWindowsContext::instance()->asyncExpose())
+ QWindowSystemInterface::flushWindowSystemEvents();
EndPaint(hwnd, &ps);
}
return true;