From 7a78756d0a4e7a2332e53940413b9e61b418345b Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 22 Nov 2023 08:59:21 +0100 Subject: [PATCH] xwayland: Add support for fractional scale protocol Add support for wp_fractional_scale_v1 protocol. Signed-off-by: Olivier Fourdan Reviewed-By: Kenny Levinsen Acked-by: Peter Hutterer Part-of: --- hw/xwayland/meson.build | 3 +++ hw/xwayland/xwayland-screen.c | 5 +++++ hw/xwayland/xwayland-screen.h | 1 + 3 files changed, 9 insertions(+) diff --git a/hw/xwayland/meson.build b/hw/xwayland/meson.build index f27c3ea2b..7a9645c00 100644 --- a/hw/xwayland/meson.build +++ b/hw/xwayland/meson.build @@ -49,6 +49,7 @@ drm_lease_xml = join_paths(protodir, 'staging', 'drm-lease', 'drm-lease-v1.xml') shortcuts_inhibit_xml = join_paths(protodir, 'unstable', 'keyboard-shortcuts-inhibit', 'keyboard-shortcuts-inhibit-unstable-v1.xml') xwayland_shell_xml = join_paths(protodir, 'staging', 'xwayland-shell', 'xwayland-shell-v1.xml') tearing_xml = join_paths(protodir, 'staging', 'tearing-control', 'tearing-control-v1.xml') +fractional_scale_xml = join_paths(protodir, 'staging', 'fractional-scale', 'fractional-scale-v1.xml') client_header = generator(scanner, output : '@BASENAME@-client-protocol.h', @@ -78,6 +79,7 @@ srcs += client_header.process(drm_lease_xml) srcs += client_header.process(shortcuts_inhibit_xml) srcs += client_header.process(xwayland_shell_xml) srcs += client_header.process(tearing_xml) +srcs += client_header.process(fractional_scale_xml) srcs += code.process(relative_xml) srcs += code.process(pointer_xml) srcs += code.process(gestures_xml) @@ -91,6 +93,7 @@ srcs += code.process(drm_lease_xml) srcs += code.process(shortcuts_inhibit_xml) srcs += code.process(xwayland_shell_xml) srcs += code.process(tearing_xml) +srcs += code.process(fractional_scale_xml) if build_ei xwayland_dep += libei_dep diff --git a/hw/xwayland/xwayland-screen.c b/hw/xwayland/xwayland-screen.c index 39e2439df..6a0f5a2ef 100644 --- a/hw/xwayland/xwayland-screen.c +++ b/hw/xwayland/xwayland-screen.c @@ -69,6 +69,7 @@ #include "xdg-shell-client-protocol.h" #include "xwayland-shell-v1-client-protocol.h" #include "tearing-control-v1-client-protocol.h" +#include "fractional-scale-v1-client-protocol.h" static DevPrivateKeyRec xwl_screen_private_key; static DevPrivateKeyRec xwl_client_private_key; @@ -507,6 +508,10 @@ registry_global(void *data, struct wl_registry *registry, uint32_t id, xwl_screen->tearing_control_manager = wl_registry_bind(registry, id, &wp_tearing_control_manager_v1_interface, 1); } + else if (strcmp(interface, wp_fractional_scale_manager_v1_interface.name) == 0) { + xwl_screen->fractional_scale_manager = + wl_registry_bind(registry, id, &wp_fractional_scale_manager_v1_interface, 1); + } #ifdef XWL_HAS_GLAMOR else if (xwl_screen->glamor) { xwl_glamor_init_wl_registry(xwl_screen, registry, id, interface, diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h index 1770053d6..d2c0865b8 100644 --- a/hw/xwayland/xwayland-screen.h +++ b/hw/xwayland/xwayland-screen.h @@ -111,6 +111,7 @@ struct xwl_screen { struct wp_viewporter *viewporter; struct xwayland_shell_v1 *xwayland_shell; struct wp_tearing_control_manager_v1 *tearing_control_manager; + struct wp_fractional_scale_manager_v1 *fractional_scale_manager; struct xorg_list drm_lease_devices; struct xorg_list queued_drm_lease_devices; struct xorg_list drm_leases;