From 485bfbd50033696424875ca57b8f1ec7c3fadad7 Mon Sep 17 00:00:00 2001 From: namedkitten Date: Sat, 11 Apr 2020 14:34:43 +0100 Subject: [PATCH] Add wayland support? --- src/Backends/MPV/MPVBackend.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Backends/MPV/MPVBackend.cpp b/src/Backends/MPV/MPVBackend.cpp index a2b9971..fe3fe05 100644 --- a/src/Backends/MPV/MPVBackend.cpp +++ b/src/Backends/MPV/MPVBackend.cpp @@ -77,10 +77,14 @@ public: { MPV_RENDER_PARAM_INVALID, nullptr }, { MPV_RENDER_PARAM_INVALID, nullptr } }; -#if __linux__ +#if defined(__linux__) || defined(__FREEBSD__) if (QGuiApplication::platformName().contains("xcb")) { params[2].type = MPV_RENDER_PARAM_X11_DISPLAY; params[2].data = QX11Info::display(); + } else if (QGuiApplication::platformName().contains("wayland")) { + params[2].type = MPV_RENDER_PARAM_WAYLAND_DISPLAY; + auto *native = QGuiApplication::platformNativeInterface(); + params[2].data = native->nativeResourceForWindow("display", NULL); } #endif