[mutter/wip/carlosg/input-thread: 75/91] backends/native: Proxy touch-mode via MetaSeatImpl
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 75/91] backends/native: Proxy touch-mode via MetaSeatImpl
- Date: Tue, 6 Oct 2020 21:13:48 +0000 (UTC)
commit 0246926b531518d8b2d32492b37e5d17efca45ed
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue Aug 11 17:19:21 2020 +0200
backends/native: Proxy touch-mode via MetaSeatImpl
Handle this via a MetaSeatImpl signal, as the heuristics that apply
here are based on libinput events. The MetaSeatNative just forwards
the touch-mode changes now.
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1403
src/backends/native/meta-seat-impl.c | 10 +++++++++-
src/backends/native/meta-seat-native.c | 13 ++++++++++++-
src/backends/native/meta-seat-native.h | 4 ++++
3 files changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 253cfd6d96..e6ed4e708c 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -109,6 +109,7 @@ enum
{
KBD_A11Y_FLAGS_CHANGED,
KBD_A11Y_MODS_STATE_CHANGED,
+ TOUCH_MODE,
N_SIGNALS
};
@@ -1443,7 +1444,7 @@ update_touch_mode (MetaSeatImpl *seat)
if (seat->touch_mode != touch_mode)
{
seat->touch_mode = touch_mode;
- g_object_notify (G_OBJECT (seat->seat), "touch-mode");
+ g_signal_emit (seat, signals[TOUCH_MODE], 0, touch_mode);
}
}
@@ -2732,6 +2733,13 @@ meta_seat_impl_class_init (MetaSeatImplClass *klass)
0, NULL, NULL, NULL,
G_TYPE_NONE, 2,
G_TYPE_UINT, G_TYPE_UINT);
+ signals[TOUCH_MODE] =
+ g_signal_new ("touch-mode",
+ G_TYPE_FROM_CLASS (object_class),
+ G_SIGNAL_RUN_LAST,
+ 0, NULL, NULL,
+ g_cclosure_marshal_VOID__BOOLEAN,
+ G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
g_object_class_install_properties (object_class, N_PROPS, props);
}
diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c
index 785c9fb148..4180997c6c 100644
--- a/src/backends/native/meta-seat-native.c
+++ b/src/backends/native/meta-seat-native.c
@@ -128,6 +128,15 @@ proxy_kbd_a11y_mods_state_changed (MetaSeatImpl *impl,
new_locked_mods);
}
+static void
+proxy_touch_mode_changed (MetaSeatImpl *impl,
+ gboolean enabled,
+ MetaSeatNative *seat_native)
+{
+ seat_native->touch_mode = enabled;
+ g_object_notify (G_OBJECT (seat_native), "touch-mode");
+}
+
static void
meta_seat_native_constructed (GObject *object)
{
@@ -138,6 +147,8 @@ meta_seat_native_constructed (GObject *object)
G_CALLBACK (proxy_kbd_a11y_flags_changed), seat);
g_signal_connect (seat->impl, "kbd-a11y-mods-state-changed",
G_CALLBACK (proxy_kbd_a11y_mods_state_changed), seat);
+ g_signal_connect (seat->impl, "touch-mode",
+ G_CALLBACK (proxy_touch_mode_changed), seat);
seat->core_pointer = meta_seat_impl_get_pointer (seat->impl);
seat->core_keyboard = meta_seat_impl_get_keyboard (seat->impl);
@@ -181,7 +192,7 @@ meta_seat_native_get_property (GObject *object,
g_value_set_string (value, seat_native->seat_id);
break;
case PROP_TOUCH_MODE:
- g_value_set_boolean (value, seat_native->impl->touch_mode);
+ g_value_set_boolean (value, seat_native->touch_mode);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
diff --git a/src/backends/native/meta-seat-native.h b/src/backends/native/meta-seat-native.h
index 8bc50856ca..ac42bcbfb5 100644
--- a/src/backends/native/meta-seat-native.h
+++ b/src/backends/native/meta-seat-native.h
@@ -56,6 +56,7 @@ struct _MetaSeatNative
GHashTable *tablet_cursors;
gboolean released;
+ gboolean touch_mode;
};
#define META_TYPE_SEAT_NATIVE meta_seat_native_get_type ()
@@ -117,5 +118,8 @@ MetaCursorRenderer * meta_seat_native_get_cursor_renderer (MetaSeatNative *s
void meta_seat_native_set_viewports (MetaSeatNative *seat,
MetaViewportInfo *viewports);
+void meta_seat_native_notify_kbd_a11y_change (MetaSeatNative *seat,
+ MetaKeyboardA11yFlags new_flags,
+ MetaKeyboardA11yFlags what_changed);
#endif /* META_SEAT_NATIVE_H */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]