From 1821c065b1b192d200f50eb1b3418cccb830b36f Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Sat, 12 Oct 2024 10:33:06 +0200 Subject: [PATCH] wayland: use wp-presentation v2 if available Version 2 allows the compositor to send an appropriate refresh rate if the output uses VRR. There are no changes to the API. Since mpv would otherwise use a heuristic based on the last-seen output, it does not matter to mpv if the output uses VRR. https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/320/diffs --- video/out/wayland_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/video/out/wayland_common.c b/video/out/wayland_common.c index d40206cee7..0c93577ee3 100644 --- a/video/out/wayland_common.c +++ b/video/out/wayland_common.c @@ -1591,7 +1591,7 @@ static void registry_handle_add(void *data, struct wl_registry *reg, uint32_t id #endif if (!strcmp(interface, wp_presentation_interface.name) && found++) { - ver = 1; + ver = MPMIN(ver, 2); wl->presentation = wl_registry_bind(reg, id, &wp_presentation_interface, ver); wp_presentation_add_listener(wl->presentation, &pres_listener, wl); }