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 <ofourdan@redhat.com>
Reviewed-By: Kenny Levinsen <kl@kl.wtf>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1197>
This commit is contained in:
Olivier Fourdan 2023-11-27 13:34:52 +01:00
parent 32dad24083
commit 8c54f90673
2 changed files with 7 additions and 0 deletions

View File

@ -1155,6 +1155,9 @@ xwl_randr_add_modes_fixed(struct xwl_output *xwl_output,
return FALSE; return FALSE;
} }
xwl_output->mode_width = current_width;
xwl_output->mode_height = current_height;
nmodes = 0; nmodes = 0;
current = 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; 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); update_screen_size(xwl_screen, mode->mode.width, mode->mode.height);
RRCrtcNotify(xwl_output->randr_crtc, mode, 0, 0, RR_Rotate_0, RRCrtcNotify(xwl_output->randr_crtc, mode, 0, 0, RR_Rotate_0,

View File

@ -54,6 +54,7 @@ struct xwl_output {
struct zxdg_output_v1 *xdg_output; struct zxdg_output_v1 *xdg_output;
uint32_t server_output_id; uint32_t server_output_id;
int32_t x, y, width, height, refresh; int32_t x, y, width, height, refresh;
int32_t mode_width, mode_height;
Rotation rotation; Rotation rotation;
Bool wl_output_done; Bool wl_output_done;
Bool xdg_output_done; Bool xdg_output_done;