mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-22 05:33:45 -04:00
ime: don’t call text-input functions when it isn’t available
Closes #259
This commit is contained in:
parent
152fb0186b
commit
797e79d3c7
2 changed files with 8 additions and 0 deletions
|
|
@ -30,6 +30,8 @@
|
||||||
|
|
||||||
* Exit when the client application terminates, not when the TTY file
|
* Exit when the client application terminates, not when the TTY file
|
||||||
descriptor is closed.
|
descriptor is closed.
|
||||||
|
* Crash on compositors not implementing the _text input_ interface
|
||||||
|
(https://codeberg.org/dnkl/foot/issues/259).
|
||||||
|
|
||||||
|
|
||||||
### Security
|
### Security
|
||||||
|
|
|
||||||
6
ime.c
6
ime.c
|
|
@ -327,6 +327,9 @@ ime_reset(struct seat *seat)
|
||||||
void
|
void
|
||||||
ime_enable(struct seat *seat)
|
ime_enable(struct seat *seat)
|
||||||
{
|
{
|
||||||
|
if (unlikely(seat->wayl->text_input_manager == NULL))
|
||||||
|
return;
|
||||||
|
|
||||||
struct terminal *term = seat->kbd_focus;
|
struct terminal *term = seat->kbd_focus;
|
||||||
assert(term != NULL);
|
assert(term != NULL);
|
||||||
|
|
||||||
|
|
@ -348,6 +351,9 @@ ime_enable(struct seat *seat)
|
||||||
void
|
void
|
||||||
ime_disable(struct seat *seat)
|
ime_disable(struct seat *seat)
|
||||||
{
|
{
|
||||||
|
if (unlikely(seat->wayl->text_input_manager == NULL))
|
||||||
|
return;
|
||||||
|
|
||||||
ime_reset(seat);
|
ime_reset(seat);
|
||||||
|
|
||||||
zwp_text_input_v3_disable(seat->wl_text_input);
|
zwp_text_input_v3_disable(seat->wl_text_input);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue