From b58cc08a3644cf298647515fca2928590c256593 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Thu, 30 Sep 2021 17:03:05 -0400 Subject: [PATCH] TextInputV2: Don't drop or convert modifiers for keysym events --- src/wayland/textinput_v2_interface.cpp | 17 ++++++++--------- src/wayland/textinput_v2_interface.h | 4 ++-- src/wayland/textinput_v2_interface_p.h | 4 ++-- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/wayland/textinput_v2_interface.cpp b/src/wayland/textinput_v2_interface.cpp index ccc43c37d3..5ed9bb9068 100644 --- a/src/wayland/textinput_v2_interface.cpp +++ b/src/wayland/textinput_v2_interface.cpp @@ -191,27 +191,27 @@ void TextInputV2InterfacePrivate::commitString(const QString &text) } } -void TextInputV2InterfacePrivate::keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) +void TextInputV2InterfacePrivate::keysymPressed(quint32 keysym, quint32 modifiers) { if (!surface) { return; } - Q_UNUSED(modifiers) + const QList textInputs = textInputsForClient(surface->client()); for (auto resource : textInputs) { - send_keysym(resource->handle, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_PRESSED, 0); + send_keysym(resource->handle, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_PRESSED, modifiers); } } -void TextInputV2InterfacePrivate::keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) +void TextInputV2InterfacePrivate::keysymReleased(quint32 keysym, quint32 modifiers) { if (!surface) { return; } - Q_UNUSED(modifiers) + const QList textInputs = textInputsForClient(surface->client()); for (auto resource : textInputs) { - send_keysym(resource->handle, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_RELEASED, 0); + send_keysym(resource->handle, seat ? seat->timestamp() : 0, keysym, WL_KEYBOARD_KEY_STATE_RELEASED, modifiers); } } @@ -438,13 +438,12 @@ void TextInputV2Interface::commitString(const QString &text) d->commitString(text); } -void TextInputV2Interface::keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers) +void TextInputV2Interface::keysymPressed(quint32 keysym, quint32 modifiers) { - Q_UNUSED(modifiers) d->keysymPressed(keysym, modifiers); } -void TextInputV2Interface::keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers) +void TextInputV2Interface::keysymReleased(quint32 keysym, quint32 modifiers) { d->keysymReleased(keysym, modifiers); } diff --git a/src/wayland/textinput_v2_interface.h b/src/wayland/textinput_v2_interface.h index 7b248403cc..b009123ee6 100644 --- a/src/wayland/textinput_v2_interface.h +++ b/src/wayland/textinput_v2_interface.h @@ -192,8 +192,8 @@ public: */ void setTextDirection(Qt::LayoutDirection direction); - void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier); - void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers = Qt::NoModifier); + void keysymPressed(quint32 keysym, quint32 modifiers = 0); + void keysymReleased(quint32 keysym, quint32 modifiers = 0); /** * Informs the client about changes in the visibility of the input panel (virtual keyboard). diff --git a/src/wayland/textinput_v2_interface_p.h b/src/wayland/textinput_v2_interface_p.h index 03013efc46..f69dac359b 100644 --- a/src/wayland/textinput_v2_interface_p.h +++ b/src/wayland/textinput_v2_interface_p.h @@ -42,8 +42,8 @@ public: void setTextDirection(Qt::LayoutDirection direction); void setPreEditCursor(qint32 index); void setCursorPosition(qint32 index, qint32 anchor); - void keysymPressed(quint32 keysym, Qt::KeyboardModifiers modifiers); - void keysymReleased(quint32 keysym, Qt::KeyboardModifiers modifiers); + void keysymPressed(quint32 keysym, quint32 modifiers); + void keysymReleased(quint32 keysym, quint32 modifiers); void sendInputPanelState(); void sendLanguage();