From 85be855032bf8332d784639eb2a6f4b23a499269 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Wed, 12 Feb 2020 10:56:07 +0000 Subject: [PATCH] text input: Disable erasing Erasing with zwp_text_input_v3 version 1 requires bytes, and bytes require get_surrounding_text. That, however, is optional. That's a mistake in protocol design. Easiest to drop this until the mess is solved on the protocol side. --- src/submission.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/submission.rs b/src/submission.rs index 7d3e2949..9ea969b2 100644 --- a/src/submission.rs +++ b/src/submission.rs @@ -139,6 +139,9 @@ impl Submission { Err(imservice::SubmitError::NotActive) => false, } }, + /* Delete_surrounding_text takes byte offsets, + * so cannot work without get_surrounding_text. + * This is a bug in the protocol. (Some(imservice), Action::Erase) => { let submit_result = imservice.delete_surrounding_text(1, 0) .and_then(|_| imservice.commit()); @@ -146,7 +149,7 @@ impl Submission { Ok(()) => true, Err(imservice::SubmitError::NotActive) => false, } - } + }*/ (_, _) => false, };