From 9490aec9c20d893772b7f4be03e8d4697fc117a4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Samuel=20R=C3=B8dal?= Date: Fri, 13 Apr 2012 09:42:55 +0200 Subject: [PATCH] Implement nativeResourceForIntegration() to get the display. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make it possible to get the display without a surface handle. Change-Id: I9d0a2bcb4515b927f440902ad14e59f3506b84de Reviewed-by: Jørgen Lind --- src/plugins/platforms/wayland/qwaylandnativeinterface.cpp | 10 ++++++++++ src/plugins/platforms/wayland/qwaylandnativeinterface.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp index a079b6e..bf40b75 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface.cpp @@ -55,6 +55,16 @@ QWaylandNativeInterface::QWaylandNativeInterface(QWaylandIntegration *integratio { } +void *QWaylandNativeInterface::nativeResourceForIntegration(const QByteArray &resourceString) +{ + QByteArray lowerCaseResource = resourceString.toLower(); + + if (lowerCaseResource == "display") + return m_integration->display()->wl_display(); + + return 0; +} + void *QWaylandNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) { QByteArray lowerCaseResource = resourceString.toLower(); diff --git a/src/plugins/platforms/wayland/qwaylandnativeinterface.h b/src/plugins/platforms/wayland/qwaylandnativeinterface.h index ef35508..bdfe8f2 100644 --- a/src/plugins/platforms/wayland/qwaylandnativeinterface.h +++ b/src/plugins/platforms/wayland/qwaylandnativeinterface.h @@ -52,6 +52,7 @@ class QWaylandNativeInterface : public QPlatformNativeInterface { public: QWaylandNativeInterface(QWaylandIntegration *integration); + void *nativeResourceForIntegration(const QByteArray &resource); void *nativeResourceForWindow(const QByteArray &resourceString, QWindow *window); -- 2.7.4