summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/xcb/qxcbintegration.cpp
diff options
context:
space:
mode:
authorJørgen Lind <jorgen.lind@nokia.com>2011-07-27 16:54:53 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2011-07-28 10:06:11 +0200
commitdfd72c6e6c5aab58bd56c8f7854e94df2230bd8d (patch)
tree72cd4bc3aca6135e8be267aaa7aedefd04a7d908 /src/plugins/platforms/xcb/qxcbintegration.cpp
parentb6b853b1b64175c191e776ffbf297bdc9de0a0fd (diff)
Make QPlatformIntegration not have a factory for eventdispatcher
but rather an accessor for the guiThreadEventDispatcher Change-Id: I1b9ba14efc9f338c5a67e3e24ddb0caf76c07413 Reviewed-on: http://codereview.qt.nokia.com/2321 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/xcb/qxcbintegration.cpp')
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/plugins/platforms/xcb/qxcbintegration.cpp b/src/plugins/platforms/xcb/qxcbintegration.cpp
index 313a773c78..7982f8dc0e 100644
--- a/src/plugins/platforms/xcb/qxcbintegration.cpp
+++ b/src/plugins/platforms/xcb/qxcbintegration.cpp
@@ -57,6 +57,9 @@
#include <stdio.h>
+//this has to be included before egl, since egl pulls in X headers
+#include <QtGui/private/qguiapplication_p.h>
+
#ifdef XCB_USE_EGL
#include <EGL/egl.h>
#endif
@@ -78,7 +81,10 @@
QXcbIntegration::QXcbIntegration(const QStringList &parameters)
: m_printerSupport(new QGenericUnixPrinterSupport)
+ , m_eventDispatcher(createUnixEventDispatcher())
{
+ QGuiApplicationPrivate::instance()->setEventDispatcher(m_eventDispatcher);
+
m_connections << new QXcbConnection;
for (int i = 0; i < parameters.size() - 1; i += 2) {
@@ -94,7 +100,7 @@ QXcbIntegration::QXcbIntegration(const QStringList &parameters)
m_fontDatabase = new QGenericUnixFontDatabase();
m_nativeInterface = new QXcbNativeInterface;
- m_inputContext = 0;
+ m_inputContext = new QIBusPlatformInputContext;
}
QXcbIntegration::~QXcbIntegration()
@@ -149,18 +155,9 @@ bool QXcbIntegration::hasCapability(QPlatformIntegration::Capability cap) const
}
}
-QAbstractEventDispatcher *QXcbIntegration::createEventDispatcher() const
+QAbstractEventDispatcher *QXcbIntegration::guiThreadEventDispatcher() const
{
- QAbstractEventDispatcher *eventDispatcher = createUnixEventDispatcher();
-
- foreach (QXcbConnection *connection, m_connections)
- connection->setEventDispatcher(eventDispatcher);
-#ifdef XCB_USE_IBUS
- // A bit hacky to do this here, but we need an eventloop before we can instantiate
- // the input context.
- const_cast<QXcbIntegration *>(this)->m_inputContext = new QIBusPlatformInputContext;
-#endif
- return eventDispatcher;
+ return m_eventDispatcher;
}
void QXcbIntegration::moveToScreen(QWindow *window, int screen)