Draft: xwayland: Multi DPI support via global factor rescaling

Dario Nieuwenhuis requested to merge dirbaio/xserver:xwlScaling into master

This is an updated version of MR !111 with some changes. Therefore credit for most of the code goes to the original author @romangg .

The original !111 automatically sets the global scale factor to the maximum scale factor of all outputs. This PR allows the wayland compositor to explicitly set the scale factor via a newly introduced XWAYLAND X protocol instead. This has a some advantages:

  • More flexibility for the compositor:
    • If the compositor wants to automatically set the scale to the max of all outputs, it can still do it himself.
    • Alternatively, it can leave the configuration to the user. For example, a user may want to optimize text quality for a lower-DPI monitor.
  • The original !111 added a --max-factor-rescale command line flag so that the compositor can advertise support. This flag is no longer needed, because compositors without xwayland scaling support won't set a scale. The default scale is 1, which is equivalent to the old behavior. Therefore this change is backwards compatible without having to add the flag.
Edited by Michel Dänzer

Merge request reports