summaryrefslogtreecommitdiff
path: root/src/protocols/TextInputV1.cpp
diff options
context:
space:
mode:
authorjoshua <54235339+sujoshua@users.noreply.github.com>2024-03-19 23:54:33 +0800
committerGitHub <noreply@github.com>2024-03-19 15:54:33 +0000
commit5c1097cbc19131a7770b2a3f01f6f24e626991d2 (patch)
treee9d27ddf894b088dd26f66dcd7280fdce46730e6 /src/protocols/TextInputV1.cpp
parent05c84304ccb1169b550504830139e07e28500a3b (diff)
IME: Improve handling of text-input and ime-relay (#5147)
* input: Handling multiple surfaces for the text-input-v1 protocol implementation and imporve InputMethodRelay logic fixes #2708 * clang-format * minor style nits --------- Co-authored-by: Vaxry <vaxry@vaxry.net>
Diffstat (limited to 'src/protocols/TextInputV1.cpp')
-rw-r--r--src/protocols/TextInputV1.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/protocols/TextInputV1.cpp b/src/protocols/TextInputV1.cpp
index d69a79ca..8d1f6f97 100644
--- a/src/protocols/TextInputV1.cpp
+++ b/src/protocols/TextInputV1.cpp
@@ -113,8 +113,6 @@ void CTextInputV1ProtocolManager::removeTI(STextInputV1* pTI) {
// if ((*TI)->resourceImpl)
// wl_resource_destroy((*TI)->resourceImpl);
- g_pInputManager->m_sIMERelay.removeTextInput((*TI)->pTextInput);
-
std::erase_if(m_pClients, [&](const auto& other) { return other.get() == pTI; });
}
@@ -165,7 +163,11 @@ void CTextInputV1ProtocolManager::createTI(wl_client* client, wl_resource* resou
void CTextInputV1ProtocolManager::handleActivate(wl_client* client, wl_resource* resource, wl_resource* seat, wl_resource* surface) {
const auto PTI = tiFromResource(resource);
- PTI->pTextInput->hyprListener_textInputEnable.emit(nullptr);
+ if (!surface) {
+ Debug::log(WARN, "Text-input-v1 PTI{:x}: No surface to activate text input on!", (uintptr_t)PTI);
+ return;
+ }
+ PTI->pTextInput->hyprListener_textInputEnable.emit(surface);
}
void CTextInputV1ProtocolManager::handleDeactivate(wl_client* client, wl_resource* resource, wl_resource* seat) {