From cf092abdfc888f19a607a43c9b4bac776b5c1f8e Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 2 Oct 2013 14:20:06 +0200 Subject: QPA: Fix event dispatcher dependent operations in platform integration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 999e5162ec3e86c9cb84c3ec95dfd0ba4b21277f breaks QPlatformIntegration implementations that perform tasks in their constructor that rely on the event dispatcher. For example creating a QSocketNotifier is not possible anymore since the event dispatcher is created later on. This is fixed by introducing an additional virtual in QPlatformIntegration that gets called after createEventDispatcher(). Two broken platform plugins have been identified so far: eglfs is creating socket notifiers to read events from input devices and xcb's input context plugins may use dbus. Both are updated accordingly. Task-number: QTBUG-33768 Change-Id: I5badb623958a52ab5314ff93dd7d60061f5df70a Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/xcb/qxcbintegration.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp') diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp index 2249446242..5168bd818b 100644 --- a/src/plugins/platforms/xcb/qxcbintegration.cpp +++ b/src/plugins/platforms/xcb/qxcbintegration.cpp @@ -172,7 +172,6 @@ QXcbIntegration::QXcbIntegration(const QStringList ¶meters, int &argc, char } m_fontDatabase.reset(new QGenericUnixFontDatabase()); - m_inputContext.reset(QPlatformInputContextFactory::create()); } QXcbIntegration::~QXcbIntegration() @@ -292,6 +291,13 @@ QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const return createUnixEventDispatcher(); } +void QXcbIntegration::initialize() +{ + // Perform everything that may potentially need the event dispatcher (timers, socket + // notifiers) here instead of the constructor. + m_inputContext.reset(QPlatformInputContextFactory::create()); +} + void QXcbIntegration::moveToScreen(QWindow *window, int screen) { Q_UNUSED(window); -- cgit v1.2.3