From 518c75a0424742a5a34cefd1feceaca49f5b7c67 Mon Sep 17 00:00:00 2001 From: Rodney Dawes Date: Thu, 30 Sep 2021 18:04:15 -0400 Subject: [PATCH] InputMethod: Use new API to pass modifiers map along to clients --- src/inputmethod.cpp | 10 ++++++++++ src/inputmethod.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index e625f8da67..81b55a6635 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -514,6 +514,7 @@ void InputMethod::adoptInputMethodContext() connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditString, this, &InputMethod::setPreeditString, Qt::UniqueConnection); connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::preeditCursor, this, &InputMethod::setPreeditCursor, Qt::UniqueConnection); connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::keyboardGrabRequested, this, &InputMethod::installKeyboardGrab, Qt::UniqueConnection); + connect(inputContext, &KWaylandServer::InputMethodContextV1Interface::modifiersMap, this, &InputMethod::updateModifiersMap, Qt::UniqueConnection); } void InputMethod::updateInputPanelState() @@ -660,6 +661,15 @@ void InputMethod::installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboar }); } +void InputMethod::updateModifiersMap(const QByteArray &modifiers) +{ + TextInputV2Interface *t2 = waylandServer()->seat()->textInputV2(); + + if (t2 && t2->isEnabled()) { + t2->setModifiersMap(modifiers); + } +} + bool InputMethod::isVisible() const { return m_inputClient && m_inputClient->isShown(false); diff --git a/src/inputmethod.h b/src/inputmethod.h index b14999ea96..6f06c663fe 100644 --- a/src/inputmethod.h +++ b/src/inputmethod.h @@ -92,6 +92,7 @@ private: void stopInputMethod(); void setTrackedClient(AbstractClient *trackedClient); void installKeyboardGrab(KWaylandServer::InputMethodGrabV1 *keyboardGrab); + void updateModifiersMap(const QByteArray &modifiers); bool touchEventTriggered() const;