xserver/hw
Olivier Fourdan e2e5842444 xwayland: Report correct mode size when rootful
The vidmode extension emulation in Xwayland reports the modeline based
on the current mode.

To do so, it searches for the mode using `xwl_output_find_mode(-1, -1)`
which is supposed to return the current mode, whatever that mode is.

With XRandR emulation, in rootless mode, the default value is the mode
at index 0. That assumption, however is not true when running rootful.

That means that the vidmode extension will always return the highest
mode available, which is 5120x2880, with Xwayland running rootful:

  $ xwayland-run -geometry 1024x768 -- xvidtune -show
  "5120x2880"   1276.50   5120 5560 6128 7136   2880 2883 2888 2982 -hsync +vsync

Luckily, when Xwayland is running rootful, we have the current mode size
conveniently stored in dedicated fields of the xwayland output struct,
so we can use that to search for the right mode being used and report
that through the vidmode extension:

  $ xwayland-run -geometry 1024x768 -- xvidtune -show
  "1024x768"     63.50   1024 1064 1176 1328    768  771  775  798 -hsync +vsync

That fixes legacy games using the vidmode extension and rendering at the
wrong size when running within Xwayland rootful.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1641>
2024-08-13 10:08:19 +02:00
..
kdrive xv: unexport XvFreeAdaptor() 2024-07-26 23:51:13 +00:00
vfb dix: unexport fields from opaque.h not used by modules/drivers 2024-06-23 21:19:27 +00:00
xfree86 compiler.h: drop translation of Sun compiler platform defines to gcc 2024-07-28 23:26:37 +00:00
xnest os: unexport ddx callbacks 2024-05-08 09:37:35 +02:00
xquartz fix missing includes of <X11/Xfuncproto.h> 2024-07-20 17:18:38 +00:00
xwayland xwayland: Report correct mode size when rootful 2024-08-13 10:08:19 +02:00
xwin fix missing includes of <X11/Xfuncproto.h> 2024-07-20 17:18:38 +00:00
meson.build Drop DMX DDX 2021-09-07 09:34:31 +00:00