From 2227e36c662d05c0a91ef6d98e8bee1ad625928d Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Fri, 25 Dec 2020 22:04:19 +0100 Subject: ime: don’t call text-input functions when it isn’t available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #259 --- ime.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ime.c') diff --git a/ime.c b/ime.c index 24237d69..9e2699f2 100644 --- a/ime.c +++ b/ime.c @@ -327,6 +327,9 @@ ime_reset(struct seat *seat) void ime_enable(struct seat *seat) { + if (unlikely(seat->wayl->text_input_manager == NULL)) + return; + struct terminal *term = seat->kbd_focus; assert(term != NULL); @@ -348,6 +351,9 @@ ime_enable(struct seat *seat) void ime_disable(struct seat *seat) { + if (unlikely(seat->wayl->text_input_manager == NULL)) + return; + ime_reset(seat); zwp_text_input_v3_disable(seat->wl_text_input); -- cgit v1.3