From ca6dfb19a04a22285ba6b2c92b97f403884936d4 Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Wed, 27 Oct 2021 12:01:41 +0200 Subject: xcb: stablilize xkb state when keymap updated QXcbKeyboard only deals with core_device_id. With the reporter's test case: using xdotool to send a string, the deviceID is not changed, then we assume xkb_state_new() is more stable(or correct) than xkb_x11_state_new_from_device() in this case. See also https://www.x.org/releases/current/doc/man/man3/xcb_xkb_new_keyboard_notify_event_t.3.xhtml . Fixes: QTBUG-95933 Change-Id: Ic595e1f1424fbc6814871a85ac159907f1aeb12a Reviewed-by: Qt CI Bot Reviewed-by: Zhang Hao Reviewed-by: Liang Qi (cherry picked from commit 27c25fc909c19ddc4750f36d26b7c500db9eb0ab) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/platforms/xcb/qxcbkeyboard.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/plugins/platforms/xcb/qxcbkeyboard.h') diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.h b/src/plugins/platforms/xcb/qxcbkeyboard.h index 1252512e13..470f690d50 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.h +++ b/src/plugins/platforms/xcb/qxcbkeyboard.h @@ -69,6 +69,7 @@ public: Qt::KeyboardModifiers translateModifiers(int s) const; void updateKeymap(xcb_mapping_notify_event_t *event); + void updateKeymap(xcb_xkb_new_keyboard_notify_event_t *event); void updateKeymap(); QList possibleKeys(const QKeyEvent *event) const; -- cgit v1.2.3