Merge branch 'preempt-render-scheduling-on-configure-events'

Closes #190
This commit is contained in:
Daniel Eklöf 2020-11-11 19:04:13 +01:00
commit 121adbe825
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 16 additions and 5 deletions

View file

@ -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

View file

@ -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 theres 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