aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2021-01-10 14:41:01 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-01-26 18:32:06 +0000
commit773b61eb79fec9966d5ccd01dccf35b02ff7a7b2 (patch)
treea4bef926bbf6b642520c420b0bdb3bae1e9736c7
parentrender: don’t center content while we’re being resized (diff)
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.
-rw-r--r--wayland.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/wayland.c b/wayland.c
index cc648244..4e8a8ca8 100644
--- a/wayland.c
+++ b/wayland.c
@@ -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);