From 2bdf594ceaaa9e6788e9090de0f3713184ed2d59 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 2 Nov 2023 10:33:22 +0100 Subject: [PATCH] xwayland: Track output scales Keep track of the output scales as advertised by the wl_output protocol. Signed-off-by: Olivier Fourdan Reviewed-By: Kenny Levinsen Acked-by: Peter Hutterer Part-of: --- hw/xwayland/xwayland-output.c | 3 +++ hw/xwayland/xwayland-output.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 8a4a55312..2c987a39f 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -725,6 +725,9 @@ output_handle_done(void *data, struct wl_output *wl_output) static void output_handle_scale(void *data, struct wl_output *wl_output, int32_t factor) { + struct xwl_output *xwl_output = data; + + xwl_output->scale = factor; } static void diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h index 5138d5e88..0e5ee6b55 100644 --- a/hw/xwayland/xwayland-output.h +++ b/hw/xwayland/xwayland-output.h @@ -54,7 +54,7 @@ struct xwl_output { struct wl_output *output; struct zxdg_output_v1 *xdg_output; uint32_t server_output_id; - int32_t x, y, width, height, refresh; + int32_t x, y, width, height, refresh, scale; int32_t mode_width, mode_height; double xscale; /* Effective scale, can be fractional */ Rotation rotation;