diff options
author | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-11-03 14:24:18 +0100 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@theqtcompany.com> | 2015-11-06 09:49:42 +0000 |
commit | 22caa63a70245087e0fca51f2186597c232e2d21 (patch) | |
tree | c2c33d9d818fe19b01958ed15d81a49aa25f5d22 | |
parent | dd9324db806466dde409750e7de17d9e327865e3 (diff) |
Try to get wl_display from the platform plugin
Some platforms require that the platform plugin creates the
wl_display. If so, use that one.
Change-Id: Ice7e0f79d525c0c7c1f79794dd6719ff8c3c7c80
Reviewed-by: Jan Arne Petersen <jan.petersen@kdab.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
-rw-r--r-- | src/compositor/compositor_api/qwaylandcompositor.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/compositor/compositor_api/qwaylandcompositor.cpp b/src/compositor/compositor_api/qwaylandcompositor.cpp index 99819d0b5..a431cdde8 100644 --- a/src/compositor/compositor_api/qwaylandcompositor.cpp +++ b/src/compositor/compositor_api/qwaylandcompositor.cpp @@ -72,6 +72,7 @@ #include <QtGui/QScreen> #include <QtGui/qpa/qwindowsysteminterface_p.h> +#include <QtGui/qpa/qplatformnativeinterface.h> #include <QtGui/private/qguiapplication_p.h> QT_BEGIN_NAMESPACE @@ -128,16 +129,19 @@ public: } // namespace QWaylandCompositorPrivate::QWaylandCompositorPrivate(QWaylandCompositor *compositor) - : display(wl_display_create()) + : display(0) #if defined (QT_COMPOSITOR_WAYLAND_GL) , use_hw_integration_extension(true) , client_buffer_integration(0) , server_buffer_integration(0) #endif - , eventHandler(new QtWayland::WindowSystemEventHandler(compositor)) , retainSelection(false) , initialized(false) { + display = static_cast<wl_display*>(QGuiApplication::platformNativeInterface()->nativeResourceForIntegration("server_wl_display")); + if (!display) + display = wl_display_create(); + eventHandler.reset(new QtWayland::WindowSystemEventHandler(compositor)); timer.start(); QWindowSystemInterfacePrivate::installWindowSystemEventHandler(eventHandler.data()); |