From 3d6975af4b0b77f13b5a4f36f82b86ed551aa85a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Nov 2015 11:28:38 +0100 Subject: Compile minimalegl QPA plugin on Windows/WinRT. Add event dispatchers. Change-Id: I548b50d1ec648fa8cb6c77881c95125f361343f0 Reviewed-by: Andrew Knight Reviewed-by: Laszlo Agocs --- .../minimalegl/qminimaleglintegration.cpp | 41 +++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp index ef96985f1a..1bcb22618e 100644 --- a/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp +++ b/src/plugins/platforms/minimalegl/qminimaleglintegration.cpp @@ -37,7 +37,15 @@ #include "qminimaleglbackingstore.h" #include -#include + +#if defined(Q_OS_UNIX) +# include +#elif defined(Q_OS_WINRT) +# include +# include +#elif defined(Q_OS_WIN) +# include +#endif #include #include @@ -48,6 +56,29 @@ QT_BEGIN_NAMESPACE +#ifdef Q_OS_WINRT +namespace { +class QWinRTEventDispatcher : public QEventDispatcherWinRT { +public: + QWinRTEventDispatcher() {} + +protected: + bool hasPendingEvents() Q_DECL_OVERRIDE + { + return QEventDispatcherWinRT::hasPendingEvents() || QWindowSystemInterface::windowSystemEventsQueued(); + } + + bool sendPostedEvents(QEventLoop::ProcessEventsFlags flags) + { + bool didProcess = QEventDispatcherWinRT::sendPostedEvents(flags); + if (!(flags & QEventLoop::ExcludeUserInputEvents)) + didProcess |= QWindowSystemInterface::sendWindowSystemEvents(flags); + return didProcess; + } +}; +} // anonymous namespace +#endif // Q_OS_WINRT + QMinimalEglIntegration::QMinimalEglIntegration() : mFontDb(new QGenericUnixFontDatabase()), mScreen(new QMinimalEglScreen(EGL_DEFAULT_DISPLAY)) { @@ -104,7 +135,15 @@ QPlatformFontDatabase *QMinimalEglIntegration::fontDatabase() const QAbstractEventDispatcher *QMinimalEglIntegration::createEventDispatcher() const { +#if defined(Q_OS_UNIX) return createUnixEventDispatcher(); +#elif defined(Q_OS_WINRT) + return new QWinRTEventDispatcher; +#elif defined(Q_OS_WIN) + return new QWindowsGuiEventDispatcher; +#else + return Q_NULLPTR; +#endif } QVariant QMinimalEglIntegration::styleHint(QPlatformIntegration::StyleHint hint) const -- cgit v1.2.3