aboutsummaryrefslogtreecommitdiffstats
path: root/sway/input
diff options
context:
space:
mode:
authorLibravatar Tadeo Kondrak <me@tadeo.ca>2021-02-08 11:35:05 -0700
committerLibravatar Tudor Brindus <me@tbrindus.ca>2021-02-15 16:45:35 -0500
commitc88f7ad1d0a59fc0994ae353551133733de6ee07 (patch)
treeaf9d4ae55ba7fdb9fadf1d3941af05c07426717a /sway/input
parenttext_input: Ignore text_input disable from unfocused windows (diff)
downloadsway-c88f7ad1d0a59fc0994ae353551133733de6ee07.tar.gz
sway-c88f7ad1d0a59fc0994ae353551133733de6ee07.tar.zst
sway-c88f7ad1d0a59fc0994ae353551133733de6ee07.zip
text_input: Only send surrounding_text and content_type if supported
Diffstat (limited to 'sway/input')
-rw-r--r--sway/input/text_input.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/sway/input/text_input.c b/sway/input/text_input.c
index 70659712..2a8f6222 100644
--- a/sway/input/text_input.c
+++ b/sway/input/text_input.c
@@ -92,13 +92,18 @@ static void relay_send_im_state(struct sway_input_method_relay *relay,
92 return; 92 return;
93 } 93 }
94 // TODO: only send each of those if they were modified 94 // TODO: only send each of those if they were modified
95 wlr_input_method_v2_send_surrounding_text(input_method, 95 if (input->active_features & WLR_TEXT_INPUT_V3_FEATURE_SURROUNDING_TEXT) {
96 input->current.surrounding.text, input->current.surrounding.cursor, 96 wlr_input_method_v2_send_surrounding_text(input_method,
97 input->current.surrounding.anchor); 97 input->current.surrounding.text, input->current.surrounding.cursor,
98 input->current.surrounding.anchor);
99 }
98 wlr_input_method_v2_send_text_change_cause(input_method, 100 wlr_input_method_v2_send_text_change_cause(input_method,
99 input->current.text_change_cause); 101 input->current.text_change_cause);
100 wlr_input_method_v2_send_content_type(input_method, 102 if (input->active_features & WLR_TEXT_INPUT_V3_FEATURE_CONTENT_TYPE) {
101 input->current.content_type.hint, input->current.content_type.purpose); 103 wlr_input_method_v2_send_content_type(input_method,
104 input->current.content_type.hint,
105 input->current.content_type.purpose);
106 }
102 wlr_input_method_v2_send_done(input_method); 107 wlr_input_method_v2_send_done(input_method);
103 // TODO: pass intent, display popup size 108 // TODO: pass intent, display popup size
104} 109}