summaryrefslogtreecommitdiff
path: root/src/managers/input/InputMethodRelay.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/managers/input/InputMethodRelay.cpp')
-rw-r--r--src/managers/input/InputMethodRelay.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/managers/input/InputMethodRelay.cpp b/src/managers/input/InputMethodRelay.cpp
index 2bd98a79..e348dcaf 100644
--- a/src/managers/input/InputMethodRelay.cpp
+++ b/src/managers/input/InputMethodRelay.cpp
@@ -49,7 +49,7 @@ void CInputMethodRelay::onNewIME(wlr_input_method_v2* pIME) {
Debug::log(LOG, "IME Destroy");
if (PTI)
- PTI->enter(PTI->focusedSurface());
+ PTI->leave();
},
this, "IMERelay");
@@ -92,8 +92,18 @@ void CInputMethodRelay::onNewIME(wlr_input_method_v2* pIME) {
},
this, "IMERelay");
- if (const auto PTI = getFocusedTextInput(); PTI)
- PTI->enter(PTI->focusedSurface());
+ if (!g_pCompositor->m_pLastFocus)
+ return;
+
+ for (auto& ti : m_vTextInputs) {
+ if (ti->client() != wl_resource_get_client(g_pCompositor->m_pLastFocus->resource))
+ continue;
+
+ if (ti->isV3())
+ ti->enter(g_pCompositor->m_pLastFocus);
+ else
+ ti->onEnabled(g_pCompositor->m_pLastFocus);
+ }
}
void CInputMethodRelay::setIMEPopupFocus(CInputPopup* pPopup, wlr_surface* pSurface) {