diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2020-12-26 11:10:04 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2020-12-26 11:10:04 +0000 |
| commit | 2f867a8c2cbfc419e824fb2c9aa0b5757a1b6d73 (patch) | |
| tree | e4cd6dc48b1bafe3ecc2203faefa0001cdedef84 | |
| parent | terminal: reaper callback: don’t close ptmx if already closed (diff) | |
| parent | ime: don’t call text-input functions when it isn’t available (diff) | |
Merge branch 'no-ime'
Closes #259
| -rw-r--r-- | CHANGELOG.md | 2 | ||||
| -rw-r--r-- | ime.c | 6 | ||||
| -rw-r--r-- | wayland.c | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index c86c0eaf..92c35225 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,8 @@ * Exit when the client application terminates, not when the TTY file descriptor is closed. +* Crash on compositors not implementing the _text input_ interface + (https://codeberg.org/dnkl/foot/issues/259). ### Security @@ -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); @@ -1130,6 +1130,13 @@ wayl_init(const struct config *conf, struct fdm *fdm) goto out; } +#if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED + if (wayl->text_input_manager == NULL) { + LOG_WARN("text input interface not implemented by compositor; " + "IME will be disabled"); + } +#endif + /* Trigger listeners registered when handling globals */ wl_display_roundtrip(wayl->display); |
