mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-02-04 20:45:41 +00:00
input/ti: avoid sending events to inactive TIs
ref https://github.com/hyprwm/Hyprland/discussions/12105
This commit is contained in:
@ -75,6 +75,11 @@ CTextInput* CInputMethodRelay::getFocusedTextInput() {
|
||||
if (!Desktop::focusState()->surface())
|
||||
return nullptr;
|
||||
|
||||
for (auto const& ti : m_textInputs) {
|
||||
if (ti->focusedSurface() == Desktop::focusState()->surface() && ti->isEnabled())
|
||||
return ti.get();
|
||||
}
|
||||
|
||||
for (auto const& ti : m_textInputs) {
|
||||
if (ti->focusedSurface() == Desktop::focusState()->surface())
|
||||
return ti.get();
|
||||
|
||||
@ -305,3 +305,7 @@ bool CTextInput::hasCursorRectangle() {
|
||||
CBox CTextInput::cursorBox() {
|
||||
return CBox{isV3() ? m_v3Input->m_current.box.cursorBox : m_v1Input->m_cursorRectangle};
|
||||
}
|
||||
|
||||
bool CTextInput::isEnabled() {
|
||||
return isV3() ? m_v3Input->m_current.enabled.value : true;
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ class CTextInput {
|
||||
void onCommit();
|
||||
void onReset();
|
||||
|
||||
bool isEnabled();
|
||||
bool hasCursorRectangle();
|
||||
CBox cursorBox();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user