From 6719307a891e3e935e5a589aaceeefb884772378 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 10 Oct 2013 09:17:52 +0200 Subject: [PATCH] WinRT: Adopt new event dispatcher approach for WinRT plugin Change-Id: I5605cbe926b57b981071d71187aca6af5d2e6269 Reviewed-by: Andrew Knight Reviewed-by: Friedemann Kleint --- src/plugins/platforms/winrt/qwinrtintegration.cpp | 13 +++++-------- src/plugins/platforms/winrt/qwinrtintegration.h | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp index 9113ffeb19..4cc7eb31f1 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.cpp +++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp @@ -103,12 +103,6 @@ QWinRTIntegration::QWinRTIntegration() m_screen = new QWinRTScreen(window); screenAdded(m_screen); - // Get event dispatcher - ICoreDispatcher *dispatcher; - if (FAILED(window->get_Dispatcher(&dispatcher))) - qCritical("Could not capture UI Dispatcher"); - m_eventDispatcher = new QWinRTEventDispatcher(dispatcher); - m_success = true; } @@ -117,9 +111,12 @@ QWinRTIntegration::~QWinRTIntegration() Windows::Foundation::Uninitialize(); } -QAbstractEventDispatcher *QWinRTIntegration::guiThreadEventDispatcher() const +QAbstractEventDispatcher *QWinRTIntegration::createEventDispatcher() const { - return m_eventDispatcher; + ICoreDispatcher *dispatcher; + if (FAILED(m_screen->coreWindow()->get_Dispatcher(&dispatcher))) + qCritical("Could not capture UI Dispatcher"); + return new QWinRTEventDispatcher(dispatcher); } bool QWinRTIntegration::hasCapability(QPlatformIntegration::Capability cap) const diff --git a/src/plugins/platforms/winrt/qwinrtintegration.h b/src/plugins/platforms/winrt/qwinrtintegration.h index b53c1cf7d2..6cf2c3e5f2 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.h +++ b/src/plugins/platforms/winrt/qwinrtintegration.h @@ -68,7 +68,7 @@ public: QPlatformWindow *createPlatformWindow(QWindow *window) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const; - QAbstractEventDispatcher *guiThreadEventDispatcher() const; + QAbstractEventDispatcher *createEventDispatcher() const; QPlatformFontDatabase *fontDatabase() const; QPlatformInputContext *inputContext() const; QPlatformServices *services() const; @@ -76,7 +76,6 @@ public: private: bool m_success; QWinRTScreen *m_screen; - QAbstractEventDispatcher *m_eventDispatcher; QPlatformFontDatabase *m_fontDatabase; QPlatformServices *m_services; };