Skip to content

xwayland: Don't expose invalid modes for fake leaseable displays

Autumn Ashton requested to merge frog/xserver:fix-chromium-drmlease-lag into master

Chromium/Electron apps will fail calls without this to glXGetMscRateOML and begin lagging/stuttering exponentially over time.

This happens because XF86VidModeGetModeLine will try to look up a mode of 0x0 as server_output_id is 0 (from calloc) and is not set from the client.

To solve this, we don't allow any mode emulation for these fake outputs, as they don't have a actual wl_output object id for a server_output_id mapping. This solves the client getting invalid (0x0@0) modes in XF86VidModeGetModeLine as it will then fall back to the first mode available via the RRmodes on this path.

We mark these fake displays as RR_Connected, so they are picked up by applications wanting to lease, the downside to this is that applications may try to take them for more than they are intended for. (Basically nothing checks non-desktop on Xrandr)

We could go through and plumb non-desktop support across Mesa, Chromium, and friends, but given there are likely proprietary applications that will never be updated to support this flag; I deem it not worth it, and this workaround to be more globally beneficial.

Ref: https://github.com/labwc/labwc/issues/553

Signed-off-by: Joshua Ashton joshua@froggi.es

Cc: @Zamundaaa

Edited by Autumn Ashton

Merge request reports

Loading