diff options
author | Dudemanguy <random342@airmail.cc> | 2022-11-14 19:06:14 -0600 |
---|---|---|
committer | Dudemanguy <random342@airmail.cc> | 2022-11-15 14:42:02 +0000 |
commit | 295ceab3820b07ad92f95f318b102fec957dd4e3 (patch) | |
tree | 34966e99b54c408fad47596fc051621c59b20eaa /video/out/wayland_common.c | |
parent | 62af31cbca6e86c217c7207d294e35e23d0c7c1f (diff) | |
download | mpv-295ceab3820b07ad92f95f318b102fec957dd4e3.tar.bz2 mpv-295ceab3820b07ad92f95f318b102fec957dd4e3.tar.xz |
wayland: error out if essential protocol support is missing
Related issue: #10868. While most protocols are in theory optional, a
small amount of them are absolutely essential and nothing will work
without them. We should make sure to error out in those cases and not
try to actually do anything. For wayland support in general,
wl_compositor support is obviously required. If there is no wl_surface,
you can't do anything. Additionally, vo_wlshm quite obviously requires
wl_shm so mark that one as well. vo_dmabuf_wayland needs linux_dmabuf,
viewporter, wl_shm, and wl_subcompositor. In practice, these are all
very standard protocols and shouldn't be missing but the linked issue
above is at least one example where a compositor was stuck on an ancient
version of a wayland interface.
Diffstat (limited to 'video/out/wayland_common.c')
-rw-r--r-- | video/out/wayland_common.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index 7dfaff2459..18d9bba450 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1931,6 +1931,12 @@ int vo_wayland_init(struct vo *vo) /* Do a roundtrip to run the registry */ wl_display_roundtrip(wl->display); + if (!wl->surface) { + MP_FATAL(wl, "Compositor doesn't support %s (ver. 4)\n", + wl_compositor_interface.name); + return false; + } + if (!wl->wm_base) { MP_FATAL(wl, "Compositor doesn't support the required %s protocol!\n", xdg_wm_base_interface.name); |