summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/minimalegl/qminimaleglintegration.cpp41
1 files changed, 40 insertions, 1 deletions
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 <QtPlatformSupport/private/qgenericunixfontdatabase_p.h>
-#include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+
+#if defined(Q_OS_UNIX)
+# include <QtPlatformSupport/private/qgenericunixeventdispatcher_p.h>
+#elif defined(Q_OS_WINRT)
+# include <QtCore/private/qeventdispatcher_winrt_p.h>
+# include <QtGui/qpa/qwindowsysteminterface.h>
+#elif defined(Q_OS_WIN)
+# include <QtPlatformSupport/private/qwindowsguieventdispatcher_p.h>
+#endif
#include <qpa/qplatformwindow.h>
#include <QtGui/QSurfaceFormat>
@@ -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