From ad8ba69423f138f3570ed558a3b6315226d34556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Wed, 19 Feb 2020 21:21:29 +0100 Subject: [PATCH] wayland/pointer: Use g_signal_connect_swapped for one signal Remove the rather useless callback function that's currently used for handling the "visibility-changed" signal and instead connect to the signal using `g_signal_connect_swapped()`. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1077 --- src/wayland/meta-wayland-pointer.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index 5ef36a9f3..d30085202 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -494,13 +494,6 @@ meta_wayland_pointer_on_cursor_changed (MetaCursorTracker *cursor_tracker, meta_wayland_surface_update_outputs (pointer->cursor_surface); } -static void -meta_wayland_pointer_on_cursor_visibility_changed (MetaCursorTracker *cursor_tracker, - MetaWaylandPointer *pointer) -{ - sync_focus_surface (pointer); -} - void meta_wayland_pointer_enable (MetaWaylandPointer *pointer) { @@ -522,10 +515,10 @@ meta_wayland_pointer_enable (MetaWaylandPointer *pointer) G_CALLBACK (meta_wayland_pointer_on_cursor_changed), pointer); - g_signal_connect (cursor_tracker, - "visibility-changed", - G_CALLBACK (meta_wayland_pointer_on_cursor_visibility_changed), - pointer); + g_signal_connect_swapped (cursor_tracker, + "visibility-changed", + G_CALLBACK (sync_focus_surface), + pointer); g_signal_connect_swapped (clutter_seat, "is-unfocus-inhibited-changed", @@ -546,7 +539,7 @@ meta_wayland_pointer_disable (MetaWaylandPointer *pointer) pointer); g_signal_handlers_disconnect_by_func (cursor_tracker, - meta_wayland_pointer_on_cursor_visibility_changed, + sync_focus_surface, pointer); g_signal_handlers_disconnect_by_func (clutter_seat,