[mutter/wip/carlosg/input-thread: 53/90] backends/native: Proxy bell notifications from within the MetaSeatImpl




commit e7d2d2cabfb457041489b43e2805bd3ad14ac354
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue Aug 11 17:32:48 2020 +0200

    backends/native: Proxy bell notifications from within the MetaSeatImpl
    
    As with other changes from within the MetaSeatImpl realm, proxy that
    through a MetaSeatImpl signal, instead of poking directly on the ClutterSeat.

 src/backends/native/meta-input-device-native.c |  2 +-
 src/backends/native/meta-seat-impl.c           | 13 +++++++++++++
 src/backends/native/meta-seat-impl.h           |  1 +
 src/backends/native/meta-seat-native.c         |  9 +++++++++
 4 files changed, 24 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/native/meta-input-device-native.c b/src/backends/native/meta-input-device-native.c
index b9f3d36fee..fde23231eb 100644
--- a/src/backends/native/meta-input-device-native.c
+++ b/src/backends/native/meta-input-device-native.c
@@ -215,7 +215,7 @@ meta_input_device_native_is_grouped (ClutterInputDevice *device,
 static void
 meta_input_device_native_bell_notify (MetaInputDeviceNative *device)
 {
-  clutter_seat_bell_notify (CLUTTER_SEAT (device->seat_impl->seat_native));
+  meta_seat_impl_notify_bell (device->seat_impl);
 }
 
 static void
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 43d5052df8..4aeb0d0c08 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -111,6 +111,7 @@ enum
   KBD_A11Y_FLAGS_CHANGED,
   KBD_A11Y_MODS_STATE_CHANGED,
   TOUCH_MODE,
+  BELL,
   N_SIGNALS
 };
 
@@ -2731,6 +2732,12 @@ meta_seat_impl_class_init (MetaSeatImplClass *klass)
                   0, NULL, NULL,
                   g_cclosure_marshal_VOID__BOOLEAN,
                   G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+  signals[BELL] =
+    g_signal_new ("bell",
+                  G_TYPE_FROM_CLASS (object_class),
+                  G_SIGNAL_RUN_LAST,
+                  0, NULL, NULL, NULL,
+                  G_TYPE_NONE, 0);
 
   g_object_class_install_properties (object_class, N_PROPS, props);
 }
@@ -3070,3 +3077,9 @@ meta_seat_impl_notify_kbd_a11y_mods_state_changed (MetaSeatImpl   *seat_impl,
   g_signal_emit (seat_impl, signals[KBD_A11Y_MODS_STATE_CHANGED], 0,
                  new_latched_mods, new_locked_mods);
 }
+
+void
+meta_seat_impl_notify_bell (MetaSeatImpl *seat_impl)
+{
+  g_signal_emit (seat_impl, signals[BELL], 0);
+}
diff --git a/src/backends/native/meta-seat-impl.h b/src/backends/native/meta-seat-impl.h
index 8d64399211..49a77298bc 100644
--- a/src/backends/native/meta-seat-impl.h
+++ b/src/backends/native/meta-seat-impl.h
@@ -246,5 +246,6 @@ void meta_seat_impl_notify_kbd_a11y_flags_changed (MetaSeatImpl          *seat_i
 void meta_seat_impl_notify_kbd_a11y_mods_state_changed (MetaSeatImpl   *seat_impl,
                                                         xkb_mod_mask_t  new_latched_mods,
                                                         xkb_mod_mask_t  new_locked_mods);
+void meta_seat_impl_notify_bell (MetaSeatImpl *seat_impl);
 
 #endif /* META_SEAT_IMPL_H */
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index ad5e5de598..f5ec6379d2 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -139,6 +139,13 @@ proxy_touch_mode_changed (MetaSeatImpl   *seat_impl,
   g_object_notify (G_OBJECT (seat_native), "touch-mode");
 }
 
+static void
+proxy_bell (MetaSeatImpl   *seat_impl,
+            MetaSeatNative *seat_native)
+{
+  clutter_seat_bell_notify (CLUTTER_SEAT (seat_native));
+}
+
 static void
 meta_seat_native_constructed (GObject *object)
 {
@@ -151,6 +158,8 @@ meta_seat_native_constructed (GObject *object)
                     G_CALLBACK (proxy_kbd_a11y_mods_state_changed), seat);
   g_signal_connect (seat->impl, "touch-mode",
                     G_CALLBACK (proxy_touch_mode_changed), seat);
+  g_signal_connect (seat->impl, "bell",
+                    G_CALLBACK (proxy_bell), seat);
 
   seat->core_pointer = meta_seat_impl_get_pointer (seat->impl);
   seat->core_keyboard = meta_seat_impl_get_keyboard (seat->impl);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]