xwayland: Set output mode size as reported by the wl_output protocol

This means xwl_output->mode_width/height can be non-0 also with
rootless, so need to check for rootful explicitly in
xwl_output_find_mode.

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2095>
(cherry picked from commit e4da0673f7)
This commit is contained in:
Michel Dänzer 2025-10-16 12:31:20 +02:00 committed by Alan Coopersmith
parent 9b6adb97ed
commit 53fadc0503

View file

@ -119,6 +119,9 @@ output_handle_mode(void *data, struct wl_output *wl_output, uint32_t flags,
xwl_output->logical_w = width;
xwl_output->logical_h = height;
}
xwl_output->mode_width = width;
xwl_output->mode_height = height;
xwl_output->refresh = refresh;
}
@ -421,8 +424,9 @@ xwl_output_find_mode(struct xwl_output *xwl_output,
/* width & height -1 means we want the actual output mode */
if (width == -1 && height == -1) {
if (xwl_output->mode_width > 0 && xwl_output->mode_height > 0) {
/* If running rootful, use the current mode size to search for the mode */
if (xwl_output == xwl_output->xwl_screen->fixed_output &&
xwl_output->mode_width > 0 && xwl_output->mode_height > 0) {
/* If running rootful, use the current fixed size to search for the mode */
width = xwl_output->mode_width;
height = xwl_output->mode_height;
}