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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3639>
This commit is contained in:
Olivier Fourdan 2024-03-04 11:48:41 +01:00
parent fef2be5c5f
commit 4c65cdec64

View File

@ -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