[mutter] wayland/pointer: Use g_signal_connect_swapped for one signal
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] wayland/pointer: Use g_signal_connect_swapped for one signal
- Date: Mon, 24 Feb 2020 10:06:28 +0000 (UTC)
commit ad8ba69423f138f3570ed558a3b6315226d34556
Author: Jonas Dreßler <verdre v0yd nl>
Date: Wed Feb 19 21:21:29 2020 +0100
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,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]