From 41d72e86e0921db4ccd9786e7a6f064fa0919fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 20 Feb 2020 12:04:15 +0100 Subject: [PATCH] backends/native: Also check touch-mode on object initialization On a Surface Pro 2017, touch-mode is currently only detected correctly after detaching and attaching the Type Cover (detachable keyboard) once, it seems that `has_external_keyboard` is only set to the correct value after MetaSeatNative is initialized. So fix that and call `update_touch_mode()` once again when the object is initialized and the `has_external_keyboard` and `has_touchscreen` properties have been finally updated. https://gitlab.gnome.org/GNOME/mutter/merge_requests/1075 --- src/backends/native/meta-seat-native.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c index 4c77b7af9..f94f43c96 100644 --- a/src/backends/native/meta-seat-native.c +++ b/src/backends/native/meta-seat-native.c @@ -2552,6 +2552,8 @@ meta_seat_native_constructed (GObject *object) seat->has_external_keyboard = has_external_keyboard (seat); seat->has_touchscreen = has_touchscreen (seat); + update_touch_mode (seat); + if (G_OBJECT_CLASS (meta_seat_native_parent_class)->constructed) G_OBJECT_CLASS (meta_seat_native_parent_class)->constructed (object); }