Skip to content

xwayland: Use {wl_,xdg-}output name for XRandR

Currently, Xwayland assigns sequential output names for XRandR. When an output is hotplugged, a new name is assigned sequentially (XWAYLAND0, XWAYLAND1, etc.). This is a problem because if a monitor is unplugged and plugged again, it will get a new name each time.

Luckily, xdg-output provides us with a name for the outputs.

Even though the protocol states that the name is not a reflection of the underlying DRM connector name, it is to remain consistent across sessions with the same hardware and software configuration.

So we could use the xdg-output name for the XRandR reported name for the output.

Doing so is a bit tricky though, because the output name is set at creation and is not supposed to change. The xdg-output event that provides us with the name will come at a later time.

So we just allocate a default fixed size for the output name at creation and just replace the default output name with the xdg-output name when that is known.

Also, historically, some X11 clients where expecting output names in Xwayladn to be named XWAYLAND and use that to check whether they were running on Xwayland. Those clients should now use the Xwayland X1 extension which is designed specifically for that purpose.

Signed-off-by: Olivier Fourdan Closes: #1353 (closed) See-also: !954 (merged)

Merge request reports