evdev: don't suspend keyboard on ThinkPad X1 Yoga 1st in tablet mode
authorDavide Depau <davide@depau.eu>
Tue, 17 Apr 2018 13:22:42 +0000 (15:22 +0200)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 18 Apr 2018 04:36:31 +0000 (14:36 +1000)
When the X1 Yoga is in tablet mode, one capacitative touch button (windows
key, sends KEY_LEFTMETA) and two side volume buttons are accessible on the
front. The key event comes through the internal keyboard that we disabled in
tablet mode so it stops working.

Luckily the Yoga physically disables the "main" keyboard when in tablet mode,
so all we have to do is skip our code to disable the keyboard and the keys are
working again.

https://bugs.freedesktop.org/show_bug.cgi?id=103749

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev-fallback.c
src/evdev.c
src/evdev.h
udev/90-libinput-model-quirks.hwdb

index 32184f8a5dc01d048bc4bdf2a575a351a9254fe5..196383d0b2f652f30875be3d24c3ff90de85c4e1 100644 (file)
@@ -1174,6 +1174,9 @@ fallback_keyboard_pair_tablet_mode(struct evdev_device *keyboard,
             (EVDEV_TAG_TRACKPOINT|EVDEV_TAG_INTERNAL_KEYBOARD)) == 0)
                return;
 
+       if (keyboard->model_flags & EVDEV_MODEL_TABLET_MODE_NO_SUSPEND)
+               return;
+
        if ((tablet_mode_switch->tags & EVDEV_TAG_TABLET_MODE_SWITCH) == 0)
                return;
 
index 309ec7d28a6e14199d002dab5a5c1da7ac2b003d..2a4682c707906ae3660c472edabf4f76f08aae9e 100644 (file)
@@ -1284,6 +1284,7 @@ evdev_read_model_flags(struct evdev_device *device)
                MODEL(TABLET_NO_PROXIMITY_OUT),
                MODEL(MS_NANO_TRANSCEIVER),
                MODEL(TABLET_NO_TILT),
+               MODEL(TABLET_MODE_NO_SUSPEND),
 #undef MODEL
                { "ID_INPUT_TRACKBALL", EVDEV_MODEL_TRACKBALL },
                { NULL, EVDEV_MODEL_DEFAULT },
index 18d33d4562691a7ee9294f5cd083da56ea19a69b..5495e94d59081a8f3e51590ee9630dcdd3bb34f1 100644 (file)
@@ -128,6 +128,7 @@ enum evdev_device_model {
        EVDEV_MODEL_TABLET_NO_PROXIMITY_OUT = (1 << 27),
        EVDEV_MODEL_MS_NANO_TRANSCEIVER = (1 << 28),
        EVDEV_MODEL_TABLET_NO_TILT = (1 << 29),
+       EVDEV_MODEL_TABLET_MODE_NO_SUSPEND = (1 << 30),
 };
 
 enum evdev_button_scroll_state {
index 7fbccf136cb911762afce99b3134b455ee018db0..602a9ff335ceb2bb84ae9a84f0e929595ae91ffd 100644 (file)
@@ -238,6 +238,11 @@ libinput:keyboard:input:b0003v17EFp6047*
 libinput:name:*ALPS TrackPoint*:svnLENOVO:*:pvrThinkPadX280:*
  LIBINPUT_ATTR_TRACKPOINT_RANGE=70
 
+# Lenovo Thinkpad X1 Yoga disables the keyboard anyway but has the same device
+# use a windows key on the screen and volume rocker on the side (#103749)
+libinput:name:AT Translated Set 2 keyboard:dmi:*svnLENOVO:*pvrThinkPadX1Yoga1st:*
+ LIBINPUT_MODEL_TABLET_MODE_NO_SUSPEND=1
+
 ##########################################
 # Logitech
 ##########################################