XWayland Adds New Option To Expose Dummy Modes For Gamescope / Steam Deck

The new "-force-xrandr-emulation" option for XWayland allows for additional, non-native modes to be exposed to the X11 client (in this case, games). This is intended for use with Wayland compositors where the Viewporter extension isn't exposed, such as the case with Valve's Gamescope compositor in use on the Steam Deck or setup by Linux gamers for use in other distributions/environments. Wayland's Viewporter protocol is what normally exposes cropping/scaling capabilities for Wayland surfaces that can be used when a surface size doesn't match the frame-buffer size. Thus important for those wanting to run their games at lower, non-standard resolutions.
Joshua Ashton, who works for Valve on different Linux components from DXVK/VKD3D to Vulkan and other Linux graphics bits, made this latest XWayland addition. In the commit he summed up the -force-xrandr-emulation option as:
Adds a -force-xrandr-emulation cmdline switch that always exposes extra modes when viewporter isn't exposed by the Wayland compositor.
Having the additional modes exposed by the X server is important for games to function and be configured
Compositors, such as Gamescope (the compositor for Steam Deck), support only a single window that is rendered in the centre of the screen that is scaled up to fill the screen by the compositor based on some user scaling settings.
Exposing viewporter, wouldn't make sense here, and could mislead native Wayland clients, so exposing dummy modesets in X is preferred here.
The patch is queued into X.Org Server Git for the next XWayland standalone release -- and presumably picked up sooner by SteamOS for Steam Deck integration.
8 Comments