render: don’t center content while doing an interactive resize

This commit is contained in:
Daniel Eklöf 2021-01-18 09:50:23 +01:00
parent 2dc774fb17
commit b4f1f72585
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 4 additions and 1 deletions

View file

@ -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_x_pad = term->width - grid_width;
const int total_y_pad = term->height - grid_height; 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.left = total_x_pad / 2;
term->margins.top = total_y_pad / 2; term->margins.top = total_y_pad / 2;
} else { } else {

View file

@ -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 * scheduled one. I.e. there will be a small delay after the user
* has *stopped* resizing, and the client application receives the * has *stopped* resizing, and the client application receives the
* final size. * 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 bool resized = was_resizing && !win->is_resizing
? render_resize_force(term, win->configure.width, win->configure.height) ? render_resize_force(term, win->configure.width, win->configure.height)