diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-22 16:26:02 +0200 |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-06-22 16:26:02 +0200 |
commit | f3440ddf52de23711b00bb6a6097ce46c9cd3f32 (patch) | |
tree | 7683e9ba9884855c8873784c93410c19643923e8 /src/plugins/platforms/wayland | |
parent | 9512c440b5d6e5d3a0e9bc7b5657f3c2f0b00d42 (diff) |
Get wayland plugin working again.
Diffstat (limited to 'src/plugins/platforms/wayland')
5 files changed, 16 insertions, 7 deletions
diff --git a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp index 41824b0efd..35c3ca3154 100644 --- a/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp +++ b/src/plugins/platforms/wayland/gl_integration/readback_glx/qwaylandreadbackglxwindow.cpp @@ -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); diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.cpp b/src/plugins/platforms/wayland/qwaylanddisplay.cpp index 6f61cf1012..d501659f51 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.cpp +++ b/src/plugins/platforms/wayland/qwaylanddisplay.cpp @@ -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())); diff --git a/src/plugins/platforms/wayland/qwaylanddisplay.h b/src/plugins/platforms/wayland/qwaylanddisplay.h index 5226f0d8e3..840f768964 100644 --- a/src/plugins/platforms/wayland/qwaylanddisplay.h +++ b/src/plugins/platforms/wayland/qwaylanddisplay.h @@ -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(); diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index bdd8235d5b..1f1ecda0e6 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -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 diff --git a/src/plugins/platforms/wayland/qwaylandwindow.cpp b/src/plugins/platforms/wayland/qwaylandwindow.cpp index ec62a3c799..34fcdad23c 100644 --- a/src/plugins/platforms/wayland/qwaylandwindow.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindow.cpp @@ -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; |