xserver-multidpi/hw/xwayland
Olivier Fourdan b0413b6e99 xwayland: Use a fixed DPI value for core protocol
The way Xwayland works (like all Wayland clients), it first queries the
Wayland registry, set up all relevant protocols and then initializes its
own structures.

That means Xwayland will get the Wayland outputs from the Wayland
compositor, compute the physical size of the combined outputs and set
the corresponding Xwayland screen properties accordingly.

Then it creates the X11 screen using fbScreenInit() but does so by using
a default DPI value of 96. That value is used to set the physical size
of the X11 screen, hence overriding the value computed from the actual
physical size provided by the Wayland compositor.

As a result, the DPI computed by tools such as xdpyinfo will always be
96 regardless of the actual screen size and resolution.

However, if the Wayland outputs get reconfigured, or new outputs added,
or existing outputs removed, Xwayland will recompute and update the
physical size of the screen, leading to an unexpected change of DPI.

To avoid that discrepancy, use a fixed size DPI (defaults to 96, and can
be set using the standard command lime option "-dpi") and compute a
physical screen size to match that DPI setting.

Note that only affects legacy core protocols, X11 clients can still get
the actual physical output size as reported by the Wayland compositor
using the RandR protocol, which also allows for the size to be 0 if the
size is unknown or meaningless.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/731
2020-07-03 12:59:23 +00: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
Makefile.am xwayland: port rooted xwayland from wl_shell to xdg-shell protocol 2020-02-28 16:23:58 +00:00
meson.build xwayland: port rooted xwayland from wl_shell to xdg-shell protocol 2020-02-28 16:23:58 +00:00
xwayland-cursor.c xwayland: Cleanup and remove xwayland.h 2019-12-20 16:19:01 +01:00
xwayland-cursor.h xwayland: Move Xwayland cursor declarations 2019-12-20 16:19:01 +01:00
xwayland-cvt.c xwayland: Cleanup and remove xwayland.h 2019-12-20 16:19:01 +01:00
xwayland-cvt.h xwayland: Move Xwayland CVT declaration 2019-12-20 16:19:01 +01:00
xwayland-glamor-eglstream.c xwayland: Include xwayland-window.h from xwayland-glamor-eglstream.c 2020-01-06 15:52:35 +01:00
xwayland-glamor-gbm.c xwayland: allow using linux-dmabuf with DRM_FORMAT_MOD_INVALID 2020-06-19 10:10:47 +00:00
xwayland-glamor-xv.c xwayland: Cleanup and remove xwayland.h 2019-12-20 16:19:01 +01:00
xwayland-glamor.c Revert "xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook" 2020-02-11 16:05:21 +01:00
xwayland-glamor.h Revert "xwayland/glamor-gbm: Add xwl_glamor_gbm_post_damage hook" 2020-02-11 16:05:21 +01:00
xwayland-glx.c xwayland: Set the vendor name for GLX_EXT_libglvnd 2020-06-05 14:50:55 -04:00
xwayland-glx.h xwayland: Move Xwayland GLX declaration 2019-12-20 16:19:01 +01:00
xwayland-input.c xwayland: Fix crashes when there is no pointer 2020-07-02 04:42:29 +00:00
xwayland-input.h xwayland: Move Xwayland cursor declarations 2019-12-20 16:19:01 +01:00
xwayland-output.c xwayland: Use a fixed DPI value for core protocol 2020-07-03 12:59:23 +00:00
xwayland-output.h xwayland: Move Xwayland output declarations 2019-12-20 16:19:01 +01:00
xwayland-pixmap.c xwayland: Separate Xwayland pixmap code 2019-12-20 16:19:01 +01:00
xwayland-pixmap.h xwayland: Separate Xwayland pixmap code 2019-12-20 16:19:01 +01:00
xwayland-present.c xwayland: Free all remaining events in xwl_present_cleanup 2020-06-25 17:32:19 +02:00
xwayland-present.h xwayland: Free all remaining events in xwl_present_cleanup 2020-06-25 17:32:19 +02:00
xwayland-screen.c xwayland: Use a fixed DPI value for core protocol 2020-07-03 12:59:23 +00:00
xwayland-screen.h xwayland: Fix infinite loop at startup 2020-04-27 11:42:13 +02:00
xwayland-shm.c xwayland: Cleanup and remove xwayland.h 2019-12-20 16:19:01 +01:00
xwayland-shm.h xwayland: Move SHM declarations to their own header 2019-12-20 16:19:01 +01:00
xwayland-types.h xwayland: Move Xwayland structures to their own header 2019-12-20 16:19:01 +01:00
xwayland-vidmode.c xwayland: Initialise values in xwlVidModeGetGamma() 2020-07-03 10:56:43 +00:00
xwayland-vidmode.h xwayland: Move Xwayland vidmode declaration 2019-12-20 16:19:01 +01:00
xwayland-window-buffers.c xwayland: Separate Xwayland screen code 2019-12-20 16:19:01 +01:00
xwayland-window-buffers.h xwayland: Cleanup and remove xwayland.h 2019-12-20 16:19:01 +01:00
xwayland-window.c xwayland: Delete all frame_callback_list nodes in xwl_unrealize_window 2020-03-17 11:45:22 +01:00
xwayland-window.h xwayland: port rooted xwayland from wl_shell to xdg-shell protocol 2020-02-28 16:23:58 +00:00
xwayland.c xwayland: Add version command line option 2020-02-14 17:04:44 +01:00