From d3ae839da6a2b5533efbf64ce999105cbd513b19 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 18 Dec 2017 15:26:48 +1000 Subject: [PATCH libinput] evdev: don't disable the keyboard on the Yoga 1 in tablet mode When the Yoga is in tablet mode, one capacitative touch button (windows key, sends KEY_LEFTMETA) is 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 keyboard when in tablet mode, so all we have to do is skip our code to disable the keyboard and the key is working again. https://bugs.freedesktop.org/show_bug.cgi?id=103749 Signed-off-by: Peter Hutterer --- src/evdev-fallback.c | 3 +++ src/evdev.h | 1 + udev/90-libinput-model-quirks.hwdb | 5 +++++ 3 files changed, 9 insertions(+) diff --git a/src/evdev-fallback.c b/src/evdev-fallback.c index 0cd2497e..5aedc5b6 100644 --- a/src/evdev-fallback.c +++ b/src/evdev-fallback.c @@ -1183,6 +1183,9 @@ fallback_keyboard_pair_tablet_mode(struct evdev_device *keyboard, if ((tablet_mode_switch->tags & EVDEV_TAG_TABLET_MODE_SWITCH) == 0) return; + if (tablet_mode_switch->tags & EVDEV_MODEL_TABLET_MODE_NEEDS_KEYBOARD) + return; + if (dispatch->tablet_mode.other.sw_device) return; diff --git a/src/evdev.h b/src/evdev.h index 75223852..635bde8a 100644 --- a/src/evdev.h +++ b/src/evdev.h @@ -124,6 +124,7 @@ enum evdev_device_model { EVDEV_MODEL_APPLE_TOUCHPAD_ONEBUTTON = (1 << 25), EVDEV_MODEL_LOGITECH_MARBLE_MOUSE = (1 << 26), EVDEV_MODEL_TABLET_NO_PROXIMITY_OUT = (1 << 27), + EVDEV_MODEL_TABLET_MODE_NEEDS_KEYBOARD = (1 << 28), }; enum evdev_button_scroll_state { diff --git a/udev/90-libinput-model-quirks.hwdb b/udev/90-libinput-model-quirks.hwdb index c23ef833..81f5f0b6 100644 --- a/udev/90-libinput-model-quirks.hwdb +++ b/udev/90-libinput-model-quirks.hwdb @@ -208,6 +208,11 @@ libinput:name:SynPS/2 Synaptics TouchPad:dmi:*svnLENOVO:*:pvrThinkPadX1Carbon3rd libinput:keyboard:input:b0003v17EFp6047* LIBINPUT_ATTR_KEYBOARD_INTEGRATION=external +# Yoga disables the keyboard anyway but has the same device use a windows +# key on the screen (#103749) +libinput:name:ThinkPad Extra Buttons:dmi:*svnLENOVO:*pvrThinkPadX1Yoga1st:* + LIBINPUT_MODEL_TABLET_MODE_NEEDS_KEYBOARD=1 + ########################################## # Logitech ########################################## -- 2.13.6