summaryrefslogtreecommitdiff
path: root/src/protocols/TextInputV3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/protocols/TextInputV3.cpp')
-rw-r--r--src/protocols/TextInputV3.cpp13
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() {