mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-08 10:06:22 -05:00
term: shutdown: handle *not* being unmapped
When we're shutting down a terminal, we destroy our Wayland window, and assume that will unmap us. There are cases when this isn't true (most likely when e.g. a screen locker is active, and the unmap is being deferred). Handle by explicitly setting focused to NULL.
This commit is contained in:
parent
8c945c9832
commit
ee45c48deb
1 changed files with 14 additions and 0 deletions
14
terminal.c
14
terminal.c
|
|
@ -590,6 +590,20 @@ fdm_shutdown(struct fdm *fdm, int fd, int events, void *data)
|
|||
term->window = NULL;
|
||||
|
||||
struct wayland *wayl __attribute__((unused)) = term->wl;
|
||||
|
||||
/*
|
||||
* Normally we'd get unmapped when we destroy the Wayland
|
||||
* above.
|
||||
*
|
||||
* However, it appears that under certain conditions, those events
|
||||
* are deferred (for example, when a screen locker is active), and
|
||||
* thus we can get here without having been unmapped.
|
||||
*/
|
||||
if (wayl->focused == term)
|
||||
wayl->focused = NULL;
|
||||
if (wayl->moused == term)
|
||||
wayl->moused = NULL;
|
||||
|
||||
assert(wayl->focused != term);
|
||||
assert(wayl->moused != term);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue