From b4f1f72585df8fbc583b9cb7f168a971cffc5e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 18 Jan 2021 09:50:23 +0100 Subject: [PATCH] =?UTF-8?q?render:=20don=E2=80=99t=20center=20content=20wh?= =?UTF-8?q?ile=20doing=20an=20interactive=20resize?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- render.c | 2 +- wayland.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/render.c b/render.c index 254057dc..1f79ad98 100644 --- a/render.c +++ b/render.c @@ -2756,7 +2756,7 @@ maybe_resize(struct terminal *term, int width, int height, bool force) const int total_x_pad = term->width - grid_width; const int total_y_pad = term->height - grid_height; - if (term->conf->center) { + if (term->conf->center && (!term->window->is_resizing)) { term->margins.left = total_x_pad / 2; term->margins.top = total_y_pad / 2; } else { diff --git a/wayland.c b/wayland.c index ec113552..d3c560b7 100644 --- a/wayland.c +++ b/wayland.c @@ -686,6 +686,9 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface, * scheduled one. I.e. there will be a small delay after the user * has *stopped* resizing, and the client application receives the * final size. + * + * Note: if we also disable content centering while resizing, then + * the last, forced, resize *is* necessary. */ bool resized = was_resizing && !win->is_resizing ? render_resize_force(term, win->configure.width, win->configure.height)