wayland: force a resize on the final configure event after an interactive resize

This is needed to apply content centering after an interactive resize,
as otherwise we’d just ignore the last configure event since the only
difference between that event and the next to last event is that the
is-resizing bit has been cleared. I.e. the window size is identical to
what we already have, and our resize code would thus ignore the event.
This commit is contained in:
Daniel Eklöf 2021-01-10 15:41:01 +01:00
parent 3948145d66
commit 773b61eb79
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -644,6 +644,8 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
struct terminal *term = win->term;
bool wasnt_configured = !win->is_configured;
bool was_resizing = win->is_resizing;
win->is_configured = true;
win->is_maximized = win->configure.is_maximized;
win->is_resizing = win->configure.is_resizing;
@ -675,8 +677,9 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
term->window->frame_callback = NULL;
}
bool resized = render_resize(
term, win->configure.width, win->configure.height);
bool resized = was_resizing && !win->is_resizing
? render_resize_force(term, win->configure.width, win->configure.height)
: render_resize(term, win->configure.width, win->configure.height);
if (win->configure.is_activated)
term_visual_focus_in(term);