mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-15 05:33:58 -04:00
term: destroy: unref key bindings *after* destroying window
This fixes a crash-on-exit on compositors that emit a _"keyboard leave"_ event when a surface is unmapped. In our case, destroying the window (where we unmap it) in term_destroy(), lead to a crash in term_mouse_grabbed(), due to key_binding_for() returning NULL. The call chain in this is case is, roughly: term_destroy() -> wayl_win_destroy() -> keyboard_leave() -> term_xcursor_update_for_seat() -> term_mouse_grabbed()
This commit is contained in:
parent
27b4c2ac2d
commit
fdd753263b
2 changed files with 4 additions and 2 deletions
|
|
@ -70,6 +70,8 @@
|
||||||
connected ([#1404][1404]).
|
connected ([#1404][1404]).
|
||||||
* Crash when _pointer capability_ is removed from a seat, on
|
* Crash when _pointer capability_ is removed from a seat, on
|
||||||
compositors without `cursor-shape-v1 support` ([#1411][1411]).
|
compositors without `cursor-shape-v1 support` ([#1411][1411]).
|
||||||
|
* Crash on exit, if the mouse is hovering over the foot window (does
|
||||||
|
not happen on all compositors)
|
||||||
|
|
||||||
[1404]: https://codeberg.org/dnkl/foot/issues/1404
|
[1404]: https://codeberg.org/dnkl/foot/issues/1404
|
||||||
[1411]: https://codeberg.org/dnkl/foot/pulls/1411
|
[1411]: https://codeberg.org/dnkl/foot/pulls/1411
|
||||||
|
|
|
||||||
|
|
@ -1607,8 +1607,6 @@ term_destroy(struct terminal *term)
|
||||||
if (term == NULL)
|
if (term == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
key_binding_unref(term->wl->key_binding_manager, term->conf);
|
|
||||||
|
|
||||||
tll_foreach(term->wl->terms, it) {
|
tll_foreach(term->wl->terms, it) {
|
||||||
if (it->item == term) {
|
if (it->item == term) {
|
||||||
tll_remove(term->wl->terms, it);
|
tll_remove(term->wl->terms, it);
|
||||||
|
|
@ -1654,6 +1652,8 @@ term_destroy(struct terminal *term)
|
||||||
}
|
}
|
||||||
mtx_unlock(&term->render.workers.lock);
|
mtx_unlock(&term->render.workers.lock);
|
||||||
|
|
||||||
|
key_binding_unref(term->wl->key_binding_manager, term->conf);
|
||||||
|
|
||||||
urls_reset(term);
|
urls_reset(term);
|
||||||
|
|
||||||
free(term->vt.osc.data);
|
free(term->vt.osc.data);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue