aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-02-29 14:46:40 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-02-29 14:46:40 +0000
commit32a3f567108236b14d811562c1e1f54ce4e29ae2 (patch)
tree31d7d8be4d5ba1289b64e9a05aeed9b92f7487fc
parentinput: start window move right away if user starts dragging the window (diff)
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.
-rw-r--r--wayland.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/wayland.c b/wayland.c
index 7322a32f..b694e23c 100644
--- a/wayland.c
+++ b/wayland.c
@@ -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);