Skip to content

xwayland: Do not round non-standard modes

Currently, Xwayland uses libxcvt to generate the mode info and then passes that to RRModeGet() to generate a RRMode.

However, libxcvt may round down the width to match the horizontal granularity (8), and that's a problem when the Wayland compositor is running a non-standard size (like, e.g. running nested with a custom size) because XRandR would report a width smaller than the actual size.

To avoid that, check whether the given width is divisible by the granularity used in libxcvt, and fallback to a simpler computation not doing any rounding if that's not the case.

Signed-off-by: Olivier Fourdan
Closes: #1540 (closed)

Edited by Olivier Fourdan

Merge request reports