presentation-time: implement support for presentation-time v3

See: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/459
This commit is contained in:
llyyr 2025-12-06 21:49:01 +05:30
parent a962d58727
commit e6e57da34f
3 changed files with 15 additions and 1 deletions

View file

@ -7,7 +7,7 @@
#include <wlr/util/addon.h>
#include "presentation-time-protocol.h"
#define PRESENTATION_VERSION 2
#define PRESENTATION_VERSION 3
struct wlr_presentation_surface_state {
struct wlr_presentation_feedback *feedback;
@ -293,6 +293,10 @@ static void feedback_handle_output_present(struct wl_listener *listener,
event.output->adaptive_sync_status == WLR_OUTPUT_ADAPTIVE_SYNC_ENABLED) {
event.refresh = 0;
}
if (wl_resource_get_version(resource) < 3) {
event.flags &= ~WLR_OUTPUT_PRESENT_VARIABLE_RATE;
event.flags &= ~WLR_OUTPUT_PRESENT_FIXED_RATE;
}
if (!feedback->zero_copy) {
event.flags &= ~WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
}