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.
This commit is contained in:
Michel Dänzer 2025-10-16 12:31:20 +02:00 committed by Michel Dänzer
parent b36f591323
commit a136452f41

View file

@ -122,6 +122,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;
}
@ -424,8 +427,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;
}