From 8c54f90673370b75b75207aaf7f5752a9cd123f9 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 27 Nov 2023 13:34:52 +0100 Subject: [PATCH] xwayland: Store the mode width/height The mode size can be different from the actual output size when a transformation is at play. Store the actual mode width/height as well in preparation for adding support for transforms. No functional change. Signed-off-by: Olivier Fourdan Reviewed-By: Kenny Levinsen Acked-by: Peter Hutterer Part-of: --- hw/xwayland/xwayland-output.c | 6 ++++++ hw/xwayland/xwayland-output.h | 1 + 2 files changed, 7 insertions(+) diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index e947ca090..349af302b 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -1155,6 +1155,9 @@ xwl_randr_add_modes_fixed(struct xwl_output *xwl_output, return FALSE; } + xwl_output->mode_width = current_width; + xwl_output->mode_height = current_height; + nmodes = 0; current = 0; @@ -1192,6 +1195,9 @@ xwl_output_set_mode_fixed(struct xwl_output *xwl_output, RRModePtr mode) { struct xwl_screen *xwl_screen = xwl_output->xwl_screen; + xwl_output->mode_width = mode->mode.width; + xwl_output->mode_height = mode->mode.height; + update_screen_size(xwl_screen, mode->mode.width, mode->mode.height); RRCrtcNotify(xwl_output->randr_crtc, mode, 0, 0, RR_Rotate_0, diff --git a/hw/xwayland/xwayland-output.h b/hw/xwayland/xwayland-output.h index 24b118dfd..68889c59d 100644 --- a/hw/xwayland/xwayland-output.h +++ b/hw/xwayland/xwayland-output.h @@ -54,6 +54,7 @@ struct xwl_output { struct zxdg_output_v1 *xdg_output; uint32_t server_output_id; int32_t x, y, width, height, refresh; + int32_t mode_width, mode_height; Rotation rotation; Bool wl_output_done; Bool xdg_output_done;