diff options
author | Tadeo Kondrak <me@tadeo.ca> | 2021-01-26 13:48:42 -0700 |
---|---|---|
committer | Tudor Brindus <me@tbrindus.ca> | 2021-02-15 16:44:15 -0500 |
commit | b0e8f4ade2e6e7831671faa05bdfd2cac0059adf (patch) | |
tree | f35edf051a77b7b38e46cbe79f02dbfe14c9baa2 /sway | |
parent | input: Commit transactions in seatop_default (diff) | |
download | sway-b0e8f4ade2e6e7831671faa05bdfd2cac0059adf.tar.gz sway-b0e8f4ade2e6e7831671faa05bdfd2cac0059adf.tar.zst sway-b0e8f4ade2e6e7831671faa05bdfd2cac0059adf.zip |
text_input: Ignore text_input disable from unfocused windows
Before this commit, there would be cases where focus changes from one
window to another, the new window activates text_input, then the old
window sends a deactivate request, making text_input unfocused
completely.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/text_input.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sway/input/text_input.c b/sway/input/text_input.c index f83726ee..70659712 100644 --- a/sway/input/text_input.c +++ b/sway/input/text_input.c | |||
@@ -144,6 +144,10 @@ static void handle_text_input_disable(struct wl_listener *listener, | |||
144 | void *data) { | 144 | void *data) { |
145 | struct sway_text_input *text_input = wl_container_of(listener, text_input, | 145 | struct sway_text_input *text_input = wl_container_of(listener, text_input, |
146 | text_input_disable); | 146 | text_input_disable); |
147 | if (text_input->input->focused_surface == NULL) { | ||
148 | sway_log(SWAY_DEBUG, "Disabling text input, but no longer focused"); | ||
149 | return; | ||
150 | } | ||
147 | relay_disable_text_input(text_input->relay, text_input); | 151 | relay_disable_text_input(text_input->relay, text_input); |
148 | } | 152 | } |
149 | 153 | ||