xwayland: Fix minimum wl_compositor protocol version

Commit 54f8fc4090 introduced the use of
wl_surface::set_buffer_scale, which is only available starting with
version 3 of the wl_compositor protocol. Because we already prefer
version 4 when available, this went unnoticed but broke versions 1, 2
and 3 when reaching the wl_surface::set_buffer_scale call.

This restores functionality for version 3 and properly document that
versions 1 and 2 are not supported anymore.

Signed-off-by: Nicolas Guichard <nicolas.guichard@kdab.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1862>
This commit is contained in:
Nicolas Guichard 2025-03-07 17:49:35 +01:00 committed by Olivier Fourdan
parent afc8b781d8
commit bcc0587ab9

View file

@ -495,7 +495,7 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id,
struct xwl_screen *xwl_screen = data;
if (strcmp(interface, wl_compositor_interface.name) == 0) {
uint32_t request_version = 1;
uint32_t request_version = WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION;
if (version >= WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION)
request_version = WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION;