xserver/hw/xwayland
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
..
desktop xwayland: Use "-decorate" if available 2024-03-18 23:19:59 +00:00
man xwayland: Update the global screen scale 2024-03-20 09:05:36 +01:00
.gitignore xwayland: Add wp_viewport wayland extension support 2019-10-12 12:19:14 +02:00
drm.xml wayland: Sync drm.xml with Mesa 2017-07-05 10:13:04 -04:00
meson.build xwayland: install pkgconfig to sharedir 2024-05-31 11:55:12 +00:00
xwayland-cursor.c xwayland: Account for the scale factor 2024-03-20 09:05:36 +01:00
xwayland-cursor.h xwayland: Add xwl_cursor_clear_frame_cb() 2021-10-25 12:05:42 +00:00
xwayland-cvt.c xwayland: Keep the CVT timings for non-standard modes 2023-05-15 10:33:21 +02:00
xwayland-cvt.h xwayland: Move Xwayland CVT declaration 2019-12-20 16:19:01 +01:00
xwayland-dmabuf.c treewide: replace xnfrealloc() calls to XNFrealloc() 2024-07-26 23:41:33 +00:00
xwayland-dmabuf.h xwayland: Move dmabuf code to its own source file 2024-03-14 15:00:46 +01:00
xwayland-drm-lease.c xwayland: Do not remove output on withdraw if leased 2024-04-30 09:13:34 +02:00
xwayland-drm-lease.h Xwayland: implement drm-lease-v1 2021-12-07 10:02:29 +00:00
xwayland-glamor-gbm.c xwayland: Do not include sys/eventfd.h without DRI3 2024-08-05 10:24:58 +02:00
xwayland-glamor-gbm.h xwayland/glamor/gbm: Copy explicit sync code to GLAMOR/GBM 2024-07-04 08:13:36 +00:00
xwayland-glamor-xv.c xv: unexport XvFreeAdaptor() 2024-07-26 23:51:13 +00:00
xwayland-glamor.c xwayland: Try manual redirection for surface window in glamor_check_flip 2024-06-24 08:26:46 +00:00
xwayland-glamor.h xwayland: Pass xwl_window to xwl_glamor_dri3_syncobj_passthrough 2024-04-10 08:55:08 +00:00
xwayland-input.c xwayland: Release keys on keyboard `enter` event if `leave` wasn't received 2024-08-05 09:10:51 +00:00
xwayland-input.h xwayland: Use xwl_window for tracking focus/touch 2024-04-10 08:55:08 +00:00
xwayland-output.c xwayland: Report correct mode size when rootful 2024-08-13 10:08:19 +02:00
xwayland-output.h xwayland: Do not remove output on withdraw if leased 2024-04-30 09:13:34 +02:00
xwayland-pixmap.c xwayland: Add xwl_pixmap_get_wl_buffer helper 2024-01-22 14:14:05 +00:00
xwayland-pixmap.h xwayland: Replace window pixmap as needed for drawing operation 2024-03-06 17:12:54 +01:00
xwayland-present.c xwayland: Do not include sys/eventfd.h without DRI3 2024-08-05 10:24:58 +02:00
xwayland-present.h xwayland: Only ignore manual redirection by clients for surface window 2024-06-24 08:26:46 +00:00
xwayland-screen.c fix missing includes of <X11/Xfuncproto.h> 2024-07-20 17:18:38 +00:00
xwayland-screen.h xwayland: Restore the ResizeWindow handler 2024-05-13 08:52:32 +00:00
xwayland-shm.c os: move os_move_fd() out of public API 2024-03-09 17:12:46 +00:00
xwayland-shm.h xwayland: Move SHM declarations to their own header 2019-12-20 16:19:01 +01:00
xwayland-types.h xwayland/window-buffers: Promote xwl_window_buffer 2024-07-04 08:13:36 +00:00
xwayland-vidmode.c dix: unexport GetCurrentClient() 2024-04-15 23:47:47 +00:00
xwayland-vidmode.h xwayland: Move Xwayland vidmode declaration 2019-12-20 16:19:01 +01:00
xwayland-window-buffers.c xwayland: Do not include sys/eventfd.h without DRI3 2024-08-05 10:24:58 +02:00
xwayland-window-buffers.h xwayland/window-buffers: optionally force disposal 2024-07-04 08:26:23 +00:00
xwayland-window.c treewide: replace xnfcalloc() calls by XNFcallocarray() 2024-07-26 23:41:33 +00:00
xwayland-window.h xwayland: Restore the ResizeWindow handler 2024-05-13 08:52:32 +00:00
xwayland-xtest.c xwayland/ei: Dequeue events when all caps are available 2024-07-31 06:04:12 +00:00
xwayland-xtest.h xwayland: Fallback to plain XTEST if EI does not work 2023-06-26 13:19:19 +02:00
xwayland.c fix missing includes of <X11/Xfuncproto.h> 2024-07-20 17:18:38 +00:00