From a14200a75c1d379153b7aabeae56fdefa7da686a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Mon, 19 Feb 2024 19:47:09 +0100 Subject: [PATCH] wayland/surface: Notify highest scale monitor after updating window monitor meta_window_update_monitor() can emit "::highest-scale-monitor-changed", and we connected to that signal right before. Let's avoid calling meta_wayland_surface_notify_highest_scale_monitor() twice and move the g_signal_connect() for that signal and the initial call to meta_wayland_surface_notify_highest_scale_monitor() to happen after meta_window_update_monitor(). Part-of: --- src/wayland/meta-wayland-shell-surface.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wayland/meta-wayland-shell-surface.c b/src/wayland/meta-wayland-shell-surface.c index 3911694be..ee086561a 100644 --- a/src/wayland/meta-wayland-shell-surface.c +++ b/src/wayland/meta-wayland-shell-surface.c @@ -139,12 +139,6 @@ meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface, priv->window = window; - priv->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); - surface_actor = meta_wayland_surface_get_actor (surface); if (surface_actor) clutter_actor_set_reactive (CLUTTER_ACTOR (surface_actor), TRUE); @@ -156,6 +150,12 @@ meta_wayland_shell_surface_set_window (MetaWaylandShellSurface *shell_surface, shell_surface); meta_window_update_monitor (window, META_WINDOW_UPDATE_MONITOR_FLAGS_NONE); + + priv->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); } void