From ca1ad7e9a56959ee8946eef1ade30d00755eac67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Fri, 5 Aug 2011 12:11:40 +0200 Subject: Get wayland plugin working after latest QPA API changes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If54e7068aaed84fe765b887250bca79c787bd8a3 Reviewed-on: http://codereview.qt.nokia.com/2684 Reviewed-by: Qt Sanity Bot Reviewed-by: Jørgen Lind --- src/gui/kernel/qplatformwindow_qpa.cpp | 1 + src/plugins/platforms/wayland/qwaylandintegration.cpp | 14 ++++++-------- src/plugins/platforms/wayland/qwaylandintegration.h | 4 +--- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/gui/kernel/qplatformwindow_qpa.cpp b/src/gui/kernel/qplatformwindow_qpa.cpp index cd4cc2e034..766967eafa 100644 --- a/src/gui/kernel/qplatformwindow_qpa.cpp +++ b/src/gui/kernel/qplatformwindow_qpa.cpp @@ -62,6 +62,7 @@ QPlatformWindow::QPlatformWindow(QWindow *window) { Q_D(QPlatformWindow); d->window = window; + d->rect = window->geometry(); } /*! diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index eb4503c829..eefd86dbf1 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -56,6 +56,7 @@ #include #include #include +#include #ifdef QT_WAYLAND_GL_SUPPORT #include "gl_integration/qwaylandglintegration.h" @@ -68,6 +69,9 @@ QWaylandIntegration::QWaylandIntegration() { QGuiApplicationPrivate::instance()->setEventDispatcher(mEventDispatcher); mDisplay = new QWaylandDisplay(); + + foreach (QPlatformScreen *screen, mDisplay->screens()) + screenAdded(screen); } QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const @@ -75,12 +79,6 @@ QPlatformNativeInterface * QWaylandIntegration::nativeInterface() const return mNativeInterface; } -QList -QWaylandIntegration::screens() const -{ - return mDisplay->screens(); -} - bool QWaylandIntegration::hasCapability(QPlatformIntegration::Capability cap) const { switch (cap) { @@ -104,10 +102,10 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons return new QWaylandShmWindow(window); } -QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const +QPlatformGLContext *QWaylandIntegration::createPlatformGLContext(QGuiGLContext *context) const { #ifdef QT_WAYLAND_GL_SUPPORT - return mDisplay->eglIntegration()->createPlatformGLContext(glFormat, share); + return mDisplay->eglIntegration()->createPlatformGLContext(context->format(), context->shareHandle()); #else Q_UNUSED(glFormat); Q_UNUSED(share); diff --git a/src/plugins/platforms/wayland/qwaylandintegration.h b/src/plugins/platforms/wayland/qwaylandintegration.h index 209d5da0da..69b8863ebc 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.h +++ b/src/plugins/platforms/wayland/qwaylandintegration.h @@ -57,13 +57,11 @@ public: bool hasCapability(QPlatformIntegration::Capability cap) const; QPlatformWindow *createPlatformWindow(QWindow *window) const; - QPlatformGLContext *createPlatformGLContext(const QSurfaceFormat &glFormat, QPlatformGLContext *share) const; + QPlatformGLContext *createPlatformGLContext(QGuiGLContext *context) const; QPlatformBackingStore *createPlatformBackingStore(QWindow *window) const; QAbstractEventDispatcher *guiThreadEventDispatcher() const; - QList screens() const; - QPlatformFontDatabase *fontDatabase() const; QPlatformNativeInterface *nativeInterface() const; -- cgit v1.2.3