summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodRelay.cpp
diff options
context:
space:
mode:
authorIkalco <73481042+ikalco@users.noreply.github.com>2024-07-29 11:14:19 -0500
committerGitHub <noreply@github.com>2024-07-29 18:14:19 +0200
commit60b663e2765c4cdb7e14fff75c4f88bf7ae312e2 (patch)
treedb6ee9dac9da1e2a1b584927543c542e31c62f80 /src/managers/input/InputMethodRelay.cpp
parent01560c9d7ccd0beec1a9c190862ee325e6f3c45e (diff)
protocols: move text-input-v1 to hyprwayland-scanner (#7096)
* move text-input-v1 to hyprwayland-scanner * vro
Diffstat (limited to 'src/managers/input/InputMethodRelay.cpp')
-rw-r--r--src/managers/input/InputMethodRelay.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp
index f1fe6421..7cfd54b4 100644
--- a/src/managers/input/InputMethodRelay.cpp
+++ b/src/managers/input/InputMethodRelay.cpp
@@ -2,6 +2,7 @@
#include "InputManager.hpp"
#include "../../Compositor.hpp"
#include "../../protocols/TextInputV3.hpp"
+#include "../../protocols/TextInputV1.hpp"
#include "../../protocols/InputMethodV2.hpp"
#include "../../protocols/core/Compositor.hpp"
@@ -9,7 +10,8 @@ CInputMethodRelay::CInputMethodRelay() {
static auto P =
g_pHookSystem->hookDynamic("keyboardFocus", [&](void* self, SCallbackInfo& info, std::any param) { onKeyboardFocus(std::any_cast<SP<CWLSurfaceResource>>(param)); });
- listeners.newTIV3 = PROTO::textInputV3->events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(ti); });
+ listeners.newTIV3 = PROTO::textInputV3->events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV3>>(ti)); });
+ listeners.newTIV1 = PROTO::textInputV1->events.newTextInput.registerListener([this](std::any ti) { onNewTextInput(std::any_cast<WP<CTextInputV1>>(ti)); });
listeners.newIME = PROTO::ime->events.newIME.registerListener([this](std::any ime) { onNewIME(std::any_cast<SP<CInputMethodV2>>(ime)); });
}
@@ -86,11 +88,11 @@ CTextInput* CInputMethodRelay::getFocusedTextInput() {
return nullptr;
}
-void CInputMethodRelay::onNewTextInput(std::any tiv3) {
- m_vTextInputs.emplace_back(std::make_unique<CTextInput>(std::any_cast<WP<CTextInputV3>>(tiv3)));
+void CInputMethodRelay::onNewTextInput(WP<CTextInputV3> tiv3) {
+ m_vTextInputs.emplace_back(std::make_unique<CTextInput>(tiv3));
}
-void CInputMethodRelay::onNewTextInput(STextInputV1* pTIV1) {
+void CInputMethodRelay::onNewTextInput(WP<CTextInputV1> pTIV1) {
m_vTextInputs.emplace_back(std::make_unique<CTextInput>(pTIV1));
}