diff options
| author | Vaxry <vaxry@vaxry.net> | 2024-04-25 23:27:25 +0100 |
|---|---|---|
| committer | Vaxry <vaxry@vaxry.net> | 2024-04-25 23:27:44 +0100 |
| commit | 1d40af64d352bd5a87c7d53a52707fc5cfc6940e (patch) | |
| tree | 7ad6d1f0dbe3f4d972faf487ffa0cbc9420ee82d /src/managers/input/InputMethodRelay.cpp | |
| parent | e87227e00ae350adebafd2adde95a47e1f68cb3a (diff) | |
text-input-v3: move to new impl
Diffstat (limited to 'src/managers/input/InputMethodRelay.cpp')
| -rw-r--r-- | src/managers/input/InputMethodRelay.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
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<wlr_surface*>(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<CTextInput>(pInput)); +void CInputMethodRelay::onNewTextInput(std::any tiv3) { + m_vTextInputs.emplace_back(std::make_unique<CTextInput>(std::any_cast<std::weak_ptr<CTextInputV3>>(tiv3))); } void CInputMethodRelay::onNewTextInput(STextInputV1* pTIV1) { |
