diff options
author | Sungyoon Cho <[email protected]> | 2024-09-06 04:04:23 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2024-09-05 20:04:23 +0100 |
commit | 727f1b54cd1ba48774092a5d54acc0e55f3ffe0f (patch) | |
tree | fffdfafce4a875bfd3622e3dc0c9395008229413 /src/protocols/TextInputV3.cpp | |
parent | c80457be02e7b75b590e025708fad38d84c99026 (diff) | |
download | Hyprland-727f1b54cd1ba48774092a5d54acc0e55f3ffe0f.tar.gz Hyprland-727f1b54cd1ba48774092a5d54acc0e55f3ffe0f.zip |
textinput: fix ime activation in some edge cases (#7660)
* textinput: clear ti3 state when focused surface gets destroyed
* textinput: send enter to newly created ti in focus
Diffstat (limited to 'src/protocols/TextInputV3.cpp')
-rw-r--r-- | src/protocols/TextInputV3.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/protocols/TextInputV3.cpp b/src/protocols/TextInputV3.cpp index 99d799f3..42dc659e 100644 --- a/src/protocols/TextInputV3.cpp +++ b/src/protocols/TextInputV3.cpp @@ -24,10 +24,9 @@ CTextInputV3::CTextInputV3(SP<CZwpTextInputV3> resource_) : resource(resource_) current = pending; serial++; - if (wasEnabled && !current.enabled) { - current.reset(); + if (wasEnabled && !current.enabled) events.disable.emit(); - } else if (!wasEnabled && current.enabled) + else if (!wasEnabled && current.enabled) events.enable.emit(); else events.onCommit.emit(); @@ -53,12 +52,12 @@ CTextInputV3::CTextInputV3(SP<CZwpTextInputV3> resource_) : resource(resource_) pending.box.cursorBox = {x, y, w, h}; }); - resource->setEnable([this](CZwpTextInputV3* r) { pending.enabled = true; }); - - resource->setDisable([this](CZwpTextInputV3* r) { - pending.enabled = false; + resource->setEnable([this](CZwpTextInputV3* r) { pending.reset(); + pending.enabled = true; }); + + resource->setDisable([this](CZwpTextInputV3* r) { pending.enabled = false; }); } CTextInputV3::~CTextInputV3() { |