diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2026-10-25 11:08:15 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2026-10-25 11:08:15 +0000 |
| commit | 152487e494993ad7fb5633a27c7d7ad0f8810ea5 (patch) | |
| tree | 33d443c7fe2fc787beae9eec92a46d7bdb860505 | |
| parent | ime: reset view and cancel selection on input (diff) | |
wayland: update_terms_on_monitor(): skip terminals in the process of shutting down
In rare cases, xdg_output_handle_done() may be called while a terminal
is shutting down. This triggered a crash in
update_terms_for_monitor(), which de-references term->window (which is
NULL for terminals shutting down).
Closes #2487
| -rw-r--r-- | CHANGELOG.md | 3 | ||||
| -rw-r--r-- | wayland.c | 19 |
2 files changed, 14 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index bcfa0262..d1a25691 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -93,11 +93,14 @@ * Possible memory leak when processing keymap data ([#2482][2482]). * Word-wise selection sometimes not working properly due to incorrect selection direction ([#2483][2483]). +* Crash in `xdg_output_handle_done()` if called when a terminal is in + the process of shutting down ([#2487][2487]). [2432]: https://codeberg.org/dnkl/foot/pulls/2432 [2467]: https://codeberg.org/dnkl/foot/issues/2467 [2482]: https://codeberg.org/dnkl/foot/pulls/2482 [2483]: https://codeberg.org/dnkl/foot/issues/2483 +[2487]: https://codeberg.org/dnkl/foot/issues/2487 ### Security @@ -439,14 +439,15 @@ update_term_for_output_change(struct terminal *term) return; } else if (term->conf->dpi_aware) { /* - * If fonts are sized according to DPI, it is possible for the cell - * size to remain the same when display scale changes. This will not - * change the surface buffer dimensions, but will change the logical - * size of the window. To ensure that the compositor is made aware of - * the proper logical size, force a resize rather than allowing - * render_resize() to shortcut the notification if the buffer - * dimensions remain the same. - */ + * If fonts are sized according to DPI, it is possible for the + * cell size to remain the same when display scale + * changes. This will not change the surface buffer + * dimensions, but will change the logical size of the + * window. To ensure that the compositor is made aware o the + * proper logical size, force a resize rather than allowing + * render_resize() to shortcut the notification if the buffer + * dimensions remain the same. + */ resize_opts |= RESIZE_FORCE; } @@ -464,6 +465,8 @@ update_terms_on_monitor(struct monitor *mon) tll_foreach(wayl->terms, it) { struct terminal *term = it->item; + if (unlikely(term->shutdown.in_progress)) + continue; tll_foreach(term->window->on_outputs, it2) { if (it2->item == mon) { |
