Get wayland plugin working again.
authorSamuel Rødal <samuel.rodal@nokia.com>
Wed, 22 Jun 2011 14:26:02 +0000 (16:26 +0200)
committerSamuel Rødal <samuel.rodal@nokia.com>
Wed, 22 Jun 2011 14:26:02 +0000 (16:26 +0200)
src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp
src/plugins/platforms/wayland/qwaylanddisplay.cpp
src/plugins/platforms/wayland/qwaylanddisplay.h
src/plugins/platforms/wayland/qwaylandintegration.cpp
src/plugins/platforms/wayland/qwaylandwindow.cpp

index 41824b0..35c3ca3 100644 (file)
@@ -104,7 +104,7 @@ void QWaylandReadbackGlxWindow::createSurface()
     XSync(m_glxIntegration->xDisplay(), False);
 
     if (!m_config)
-        m_config = qglx_findConfig(m_glxIntegration->xDisplay(), m_glxIntegration->screen(), m_window->glFormat());
+        m_config = qglx_findConfig(m_glxIntegration->xDisplay(), m_glxIntegration->screen(), m_window->format());
 
     m_glxPixmap = glXCreatePixmap(m_glxIntegration->xDisplay(), m_config, m_pixmap,0);
 
index 6f61cf1..d501659 100644 (file)
@@ -152,9 +152,12 @@ QWaylandDisplay::QWaylandDisplay(void)
     mEglIntegration->initialize();
 #endif
 
-    connect(QAbstractEventDispatcher::instance(), SIGNAL(aboutToBlock()), this, SLOT(flushRequests()));
-
     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()));
index 5226f0d..840f768 100644 (file)
@@ -49,6 +49,7 @@
 
 #include <wayland-client.h>
 
+class QAbstractEventDispatcher;
 class QWaylandInputDevice;
 class QSocketNotifier;
 class QWaylandBuffer;
@@ -91,6 +92,8 @@ public:
 
     QList<QWaylandInputDevice *> inputDevices() const { return mInputDevices; }
 
+    void eventDispatcherCreated(QAbstractEventDispatcher *dispatcher);
+
 public slots:
     void createNewScreen(struct wl_output *output, QRect geometry);
     void readEvents();
index bdd8235..1f1ecda 100644 (file)
@@ -101,10 +101,10 @@ QPixmapData *QWaylandIntegration::createPixmapData(QPixmapData::PixelType type)
 QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) const
 {
 #ifdef QT_WAYLAND_GL_SUPPORT
-    return mDisplay->eglIntegration()->createEglWindow(window);
-#else
-    return new QWaylandShmWindow(window);
+    if (window->surfaceType() == QWindow::OpenGLSurface)
+        return mDisplay->eglIntegration()->createEglWindow(window);
 #endif
+    return new QWaylandShmWindow(window);
 }
 
 QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const
@@ -125,7 +125,9 @@ QPlatformBackingStore *QWaylandIntegration::createPlatformBackingStore(QWindow *
 
 QAbstractEventDispatcher *QWaylandIntegration::createEventDispatcher() const
 {
-    return createUnixEventDispatcher();
+    QAbstractEventDispatcher *dispatcher = createUnixEventDispatcher();
+    mDisplay->eventDispatcherCreated(dispatcher);
+    return dispatcher;
 }
 
 QPlatformFontDatabase *QWaylandIntegration::fontDatabase() const
index ec62a3c..34fcdad 100644 (file)
@@ -104,6 +104,7 @@ void QWaylandWindow::setVisible(bool visible)
 
     if (visible) {
         wl_surface_map_toplevel(mSurface);
+        QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(), geometry().size()));
     } else {
         wl_surface_destroy(mSurface);
         mSurface = NULL;