summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodRelay.cpp
diff options
context:
space:
mode:
authoroutfoxxed <outfoxxed@outfoxxed.me>2025-07-08 09:56:40 -0700
committerGitHub <noreply@github.com>2025-07-08 18:56:40 +0200
commit78e9eddfb6bfbc6b103fc60c9831b23ef252886b (patch)
tree4daf06580d89dec717a282c4ec8729285241c8e8 /src/managers/input/InputMethodRelay.cpp
parent2f34ef141b0728857d2a6f777c608dfe4c207733 (diff)
core: use new typed signals from hu (#10853)
Diffstat (limited to 'src/managers/input/InputMethodRelay.cpp')
-rw-r--r--src/managers/input/InputMethodRelay.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp
index 40c87f95..c09d0624 100644
--- a/src/managers/input/InputMethodRelay.cpp
+++ b/src/managers/input/InputMethodRelay.cpp
@@ -11,9 +11,9 @@ CInputMethodRelay::CInputMethodRelay() {
static auto P =
g_pHookSystem->hookDynamic("keyboardFocus", [&](void* self, SCallbackInfo& info, std::any param) { onKeyboardFocus(std::any_cast<SP<CWLSurfaceResource>>(param)); });
- m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV3>>(ti)); });
- m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV1>>(ti)); });
- m_listeners.newIME = PROTO::ime->m_events.newIME.registerListener([this](std::any ime) { onNewIME(std::any_cast<SP<CInputMethodV2>>(ime)); });
+ m_listeners.newTIV3 = PROTO::textInputV3->m_events.newTextInput.listen([this](const auto& input) { onNewTextInput(input); });
+ m_listeners.newTIV1 = PROTO::textInputV1->m_events.newTextInput.listen([this](const auto& input) { onNewTextInput(input); });
+ m_listeners.newIME = PROTO::ime->m_events.newIME.listen([this](const auto& ime) { onNewIME(ime); });
}
void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
@@ -27,7 +27,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
m_inputMethod = pIME;
- m_listeners.commitIME = pIME->m_events.onCommit.registerListener([this](std::any d) {
+ m_listeners.commitIME = pIME->m_events.onCommit.listen([this] {
const auto PTI = getFocusedTextInput();
if (!PTI) {
@@ -38,7 +38,7 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
PTI->updateIMEState(m_inputMethod.lock());
});
- m_listeners.destroyIME = pIME->m_events.destroy.registerListener([this](std::any d) {
+ m_listeners.destroyIME = pIME->m_events.destroy.listen([this] {
const auto PTI = getFocusedTextInput();
Debug::log(LOG, "IME Destroy");
@@ -49,9 +49,8 @@ void CInputMethodRelay::onNewIME(SP<CInputMethodV2> pIME) {
m_inputMethod.reset();
});
- m_listeners.newPopup = pIME->m_events.newPopup.registerListener([this](std::any d) {
- m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(std::any_cast<SP<CInputMethodPopupV2>>(d)));
-
+ m_listeners.newPopup = pIME->m_events.newPopup.listen([this](const SP<CInputMethodPopupV2>& popup) {
+ m_inputMethodPopups.emplace_back(makeUnique<CInputPopup>(popup));
Debug::log(LOG, "New input popup");
});