aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-11-11 18:04:13 +0000
committerDaniel Eklöf <daniel@ekloef.se>2020-11-11 18:04:13 +0000
commit121adbe825e56932027a35ccf2779757d5e8edda (patch)
tree6ef5a984e313d6dbc0cc04556ca7f7a54ffef055
parentclient: let getopt_long(3) print error messages (diff)
parentwayland: preempt render scheduling in ‘configure’ events (diff)
Merge branch 'preempt-render-scheduling-on-configure-events'
Closes #190
-rw-r--r--CHANGELOG.md2
-rw-r--r--wayland.c19
2 files changed, 16 insertions, 5 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 645b6eeb..468f897d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -68,6 +68,8 @@
not possible to add a command to these actions when used in mouse
bindings, making them useless
(https://codeberg.org/dnkl/foot/issues/183).
+* Resize very slow when window is hidden
+ (https://codeberg.org/dnkl/foot/issues/190).
### Security
diff --git a/wayland.c b/wayland.c
index 37b47f30..b8cd9cd9 100644
--- a/wayland.c
+++ b/wayland.c
@@ -614,17 +614,26 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
xdg_surface_ack_configure(xdg_surface, serial);
- /* TODO: check with GNOME and tiling - presumably that didn't work
- * unless we presented a *new* buffer, hence we used to do a force
- * resize here */
- bool resized = render_resize(term, win->configure.width, win->configure.height);
+ if (term->window->frame_callback != NULL) {
+ /*
+ * Preempt render scheduling.
+ *
+ * Each configure event require a corresponding new
+ * surface+commit. Thus we cannot just schedule a pending
+ * refresh if there’s already a frame being rendered.
+ */
+ wl_callback_destroy(term->window->frame_callback);
+ term->window->frame_callback = NULL;
+ }
+
+ bool resized = render_resize(
+ term, win->configure.width, win->configure.height);
if (win->configure.is_activated)
term_visual_focus_in(term);
else
term_visual_focus_out(term);
- /* TODO: remove - shouldn't be necessary with render_resize_force() */
if (!resized) {
/*
* If we didn't resize, we won't be committing a new surface