1
0
Fork 0

Add wayland support?

This commit is contained in:
namedkitten 2020-04-11 14:34:43 +01:00
parent 57423ead89
commit 485bfbd500

View file

@ -77,10 +77,14 @@ public:
{ MPV_RENDER_PARAM_INVALID, nullptr }, { MPV_RENDER_PARAM_INVALID, nullptr },
{ MPV_RENDER_PARAM_INVALID, nullptr } { MPV_RENDER_PARAM_INVALID, nullptr }
}; };
#if __linux__ #if defined(__linux__) || defined(__FREEBSD__)
if (QGuiApplication::platformName().contains("xcb")) { if (QGuiApplication::platformName().contains("xcb")) {
params[2].type = MPV_RENDER_PARAM_X11_DISPLAY; params[2].type = MPV_RENDER_PARAM_X11_DISPLAY;
params[2].data = QX11Info::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 #endif