From 4c65cdec641d1b44099b3b646e2d9aadfc38a5db Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 4 Mar 2024 11:48:41 +0100 Subject: [PATCH] xwayland/surface: Connect "highest-scale-monitor-changed" signal Similar to what MetaWaylandShellSurface does, connect the signal "highest-scale-monitor-changed" to the handler meta_wayland_surface_notify_highest_scale_monitor() so that Xwaylandsurface can be notified of the fractional scale changes. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/3326 Part-of: --- src/wayland/meta-xwayland-surface.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/wayland/meta-xwayland-surface.c b/src/wayland/meta-xwayland-surface.c index c6daf9b26..ce04501b5 100644 --- a/src/wayland/meta-xwayland-surface.c +++ b/src/wayland/meta-xwayland-surface.c @@ -43,6 +43,7 @@ struct _MetaXwaylandSurface MetaWindow *window; gulong unmanaging_handler_id; + gulong highest_scale_monitor_handler_id; }; G_DEFINE_TYPE (MetaXwaylandSurface, @@ -64,6 +65,8 @@ clear_window (MetaXwaylandSurface *xwayland_surface) g_clear_signal_handler (&xwayland_surface->unmanaging_handler_id, xwayland_surface->window); + g_clear_signal_handler (&xwayland_surface->highest_scale_monitor_handler_id, + xwayland_surface->window); xwayland_window = META_WINDOW_XWAYLAND (xwayland_surface->window); meta_window_xwayland_set_surface (xwayland_window, NULL); xwayland_surface->window = NULL; @@ -126,6 +129,12 @@ meta_xwayland_surface_associate_with_window (MetaXwaylandSurface *xwayland_surfa window_actor = meta_window_actor_from_window (window); if (window_actor) meta_window_actor_assign_surface_actor (window_actor, surface_actor); + + xwayland_surface->highest_scale_monitor_handler_id = + g_signal_connect_swapped (window, "highest-scale-monitor-changed", + G_CALLBACK (meta_wayland_surface_notify_highest_scale_monitor), + surface); + meta_wayland_surface_notify_highest_scale_monitor (surface); } static void