From 1d40af64d352bd5a87c7d53a52707fc5cfc6940e Mon Sep 17 00:00:00 2001 From: Vaxry Date: Thu, 25 Apr 2024 23:27:25 +0100 Subject: text-input-v3: move to new impl --- src/managers/input/InputMethodRelay.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/managers/input/InputMethodRelay.cpp') diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp index 17da87ea..4f1cd278 100644 --- a/src/managers/input/InputMethodRelay.cpp +++ b/src/managers/input/InputMethodRelay.cpp @@ -1,9 +1,12 @@ #include "InputMethodRelay.hpp" #include "InputManager.hpp" #include "../../Compositor.hpp" +#include "../../protocols/TextInputV3.hpp" CInputMethodRelay::CInputMethodRelay() { static auto P = g_pHookSystem->hookDynamic("keyboardFocus", [&](void* self, SCallbackInfo& info, std::any param) { onKeyboardFocus(std::any_cast(param)); }); + + listeners.newTIV3 = PROTO::textInputV3->events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(ti); }); } void CInputMethodRelay::onNewIME(wlr_input_method_v2* pIME) { @@ -142,8 +145,8 @@ CTextInput* CInputMethodRelay::getFocusedTextInput() { return nullptr; } -void CInputMethodRelay::onNewTextInput(wlr_text_input_v3* pInput) { - m_vTextInputs.emplace_back(std::make_unique(pInput)); +void CInputMethodRelay::onNewTextInput(std::any tiv3) { + m_vTextInputs.emplace_back(std::make_unique(std::any_cast>(tiv3))); } void CInputMethodRelay::onNewTextInput(STextInputV1* pTIV1) { -- cgit v1.2.3