mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
wayland: don't resize when we're not mapped anywhere
Normally, we resize and update the font's DPI whenever our window enters or leaves an output. This is since a change in the outputs we're mapped on means the scale factor to use, or the DPI to use for the fonts may have changed. However, a special case is when we're removed from the last output. This should only happen at shutdown, when we're un-mapping ourselves. In this case, we typically don't have a access to e.g. the PTMX fd (often, the reason we're shutting down is because the client exited). This resulted in (harmless) error messages when emitting the TIOCSWINSZ event. Since we're shutting down anyway, we can simply skip the resize and everything. This gets rid of the error message, and also means we're shutting down faster.
This commit is contained in:
parent
ea2d7f8b8c
commit
32a3f56710
1 changed files with 3 additions and 0 deletions
|
|
@ -133,6 +133,9 @@ static const struct wl_seat_listener seat_listener = {
|
|||
static void
|
||||
update_term_for_output_change(struct terminal *term)
|
||||
{
|
||||
if (tll_length(term->window->on_outputs) == 0)
|
||||
return;
|
||||
|
||||
render_resize(term, term->width / term->scale, term->height / term->scale);
|
||||
term_font_dpi_changed(term);
|
||||
wayl_reload_cursor_theme(term->wl, term);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue