diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-11-21 17:17:02 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-11-21 17:17:02 +0000 |
| commit | 8c945c9832f94835cd6482a6525217cd21da08af (patch) | |
| tree | 169914e9122f92272f81a09a68d5daba7c7b9047 /input.c | |
| parent | log: set syslog facility to LOG_DAEMON when run in server mode (diff) | |
input: may get keyboard_exit() event with no focused terminal
This happens on Sway when exiting a screen locker. Or at least that's
when we see the problem; it's unclear if the event occurs when
starting the screen locker, or when exiting it. Or maybe its both.
Anyway, don't try to unfocus a NULL-terminal.
Diffstat (limited to 'input.c')
| -rw-r--r-- | input.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -138,8 +138,12 @@ keyboard_leave(void *data, struct wl_keyboard *wl_keyboard, uint32_t serial, { struct wayland *wayl = data; + assert(wayl->focused == NULL || + wayl_terminal_from_surface(wayl, surface) == wayl->focused); + stop_repeater(wayl, -1); - term_focus_out(wayl->focused); + if (wayl->focused != NULL) + term_focus_out(wayl->focused); wayl->focused = NULL; } |
