From c6737b1ae013b1095100a0354c1441bc4c419076 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Tue, 8 Mar 2022 02:59:56 +0100 Subject: [PATCH] inputmethod: Listen to text-input enablement changes when starting disabled We will need to know about it eventually if the user enables the input method. It's guarded with an if so it's no-op. --- src/inputmethod.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/inputmethod.cpp b/src/inputmethod.cpp index c5f1318158..9aa254c352 100644 --- a/src/inputmethod.cpp +++ b/src/inputmethod.cpp @@ -98,16 +98,13 @@ void InputMethod::init() connect(textInputV2, &TextInputV2Interface::surroundingTextChanged, this, &InputMethod::surroundingTextChanged); connect(textInputV2, &TextInputV2Interface::contentTypeChanged, this, &InputMethod::contentTypeChanged); connect(textInputV2, &TextInputV2Interface::stateUpdated, this, &InputMethod::textInputInterfaceV2StateUpdated); + connect(textInputV2, &TextInputV2Interface::enabledChanged, this, &InputMethod::textInputInterfaceV2EnabledChanged); TextInputV3Interface *textInputV3 = waylandServer()->seat()->textInputV3(); connect(textInputV3, &TextInputV3Interface::surroundingTextChanged, this, &InputMethod::surroundingTextChanged); connect(textInputV3, &TextInputV3Interface::contentTypeChanged, this, &InputMethod::contentTypeChanged); connect(textInputV3, &TextInputV3Interface::stateCommitted, this, &InputMethod::stateCommitted); - - if (m_enabled) { - connect(textInputV2, &TextInputV2Interface::enabledChanged, this, &InputMethod::textInputInterfaceV2EnabledChanged); - connect(textInputV3, &TextInputV3Interface::enabledChanged, this, &InputMethod::textInputInterfaceV3EnabledChanged); - } + connect(textInputV3, &TextInputV3Interface::enabledChanged, this, &InputMethod::textInputInterfaceV3EnabledChanged); connect(input()->keyboard()->xkb(), &Xkb::modifierStateChanged, this, [this]() { m_hasPendingModifiers = true;