xwayland: Multi DPI support via global factor rescaling

To benefit from Wayland's multi DPI capabilities in XWayland a global scaling
factor is introduced, which is applied to all outputs.

The RandR size of an output is calculated by the (integer-)multiplication of
this global scaling factor with its logical size received via the xdg-output
protocol.

In other words the size of any RandR screen corresponds to the mode size of
its wl_output multiplied with the quotient of global scaling factor divided by
the compositor's internal output-dependent scaling factor.

HiDPI aware X clients can then provide Pixmaps enlarged by the global scaling
factor and the Wayland compositor is supposed to downscale these buffers on
outputs scaled by less than the global scaling factor.

A Wayland compositor needs to scale all X communication in its XWM part by the
global scaling factor, such that X windows have the correct geometry.

In summary:
* All positions in Wayland internal communication must be carried out by the
compositor in logical coordinates, i.e. in its compositor space.
* All positions in X internal communication are based on RandR sizes.
* All positions in Wayland to X communication must be multiplied by the global
scaling factor.
* All positions in X to Wayland communication must be divided by the global
scaling factor.

In order to not break compositors that do not support these transformations,
the global scaling factor is set to 1 by default, which behaves the same as
before. The compositor must explicitly set the global scaling factor via the
new XWAYLAND protocol. Changing the scaling factor on the fly on a running
X server is supported.

[dirbaio@dirbaio.net: fix incorrect scaling in a few places]
Signed-off-by: Roman Gilg <subdiff@gmail.com>
Signed-off-by: Dario Nieuwenhuis <dirbaio@dirbaio.net>
4 jobs for xwlScaling in 6 minutes and 24 seconds (queued for 1 second)
latest
Status Job ID Name Coverage
  Docker Image
passed #2537039
debian-testing

00:00:15

 
  Build And Test
passed #2537040
autotools

00:06:09

passed #2537041
meson

00:01:38

passed #2537042
meson-noglamor

00:02:01