Make QPlatformIntegration not have a factory for eventdispatcher
[profile/ivi/qtwayland.git] / src / plugins / platforms / wayland / qwaylanddisplay.cpp
index ca0e657..5880969 100644 (file)
@@ -142,6 +142,13 @@ QWaylandDisplay::QWaylandDisplay(void)
 
     wl_display_add_global_listener(mDisplay, QWaylandDisplay::displayHandleGlobal, this);
 
+    mFd = wl_display_get_fd(mDisplay, sourceUpdate, this);
+    QAbstractEventDispatcher *dispatcher = QGuiApplicationPrivate::eventDispatcher;
+    connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(flushRequests()));
+
+    mReadNotifier = new QSocketNotifier(mFd, QSocketNotifier::Read, this);
+    connect(mReadNotifier, SIGNAL(activated(int)), this, SLOT(readEvents()));
+
 #ifdef QT_WAYLAND_GL_SUPPORT
     mEglIntegration = QWaylandGLIntegration::createGLIntegration(this);
 #endif
@@ -156,16 +163,6 @@ QWaylandDisplay::QWaylandDisplay(void)
     mEglIntegration->initialize();
 #endif
 
-    mFd = wl_display_get_fd(mDisplay, sourceUpdate, this);
-}
-
-void QWaylandDisplay::eventDispatcherCreated(QAbstractEventDispatcher *dispatcher)
-{
-    connect(dispatcher, SIGNAL(aboutToBlock()), this, SLOT(flushRequests()));
-
-    mReadNotifier = new QSocketNotifier(mFd, QSocketNotifier::Read, this);
-    connect(mReadNotifier, SIGNAL(activated(int)), this, SLOT(readEvents()));
-
     waitForScreens();
 }