diff options
| author | Manuel Stoeckl <code@mstoeckl.com> | 2023-03-12 16:48:58 -0400 |
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2023-03-22 10:56:42 +0100 |
| commit | 1d3e62c67f07a180fca02a6df1cf9648f2b50349 (patch) | |
| tree | 598dd26d5a62ade9ee705073cad83c8d71b7617f /include/swaylock.h | |
| parent | ac3b49b6571ceda3f8db11a98bfe320106996280 (diff) | |
Stop pooling background surface buffers
The wl_buffers for the background surface only need to be updated
when the output dimensions change. Using the fixed pool of two
buffers to cache these buffers does not help, since if a new buffer
is needed, it will have a different size than whatever buffers were
cached. Furthermore, because the pool has fixed size, it is possible
to run out of buffers if configure events arrive faster than
pool buffers are marked not busy, which can lead to protocol errors
when the background surface is committed after acknowledging a new
size, but without attaching a buffer that matches that size.
Diffstat (limited to 'include/swaylock.h')
| -rw-r--r-- | include/swaylock.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/swaylock.h b/include/swaylock.h index 9de8ab6..bb71c8c 100644 --- a/include/swaylock.h +++ b/include/swaylock.h @@ -98,11 +98,10 @@ struct swaylock_surface { struct swaylock_state *state; struct wl_output *output; uint32_t output_global_name; - struct wl_surface *surface; - struct wl_surface *child; // surface made into subsurface + struct wl_surface *surface; // surface for background + struct wl_surface *child; // indicator surface made into subsurface struct wl_subsurface *subsurface; struct ext_session_lock_surface_v1 *ext_session_lock_surface_v1; - struct pool_buffer buffers[2]; struct pool_buffer indicator_buffers[2]; bool frame_pending, dirty; uint32_t width, height; @@ -110,6 +109,8 @@ struct swaylock_surface { enum wl_output_subpixel subpixel; char *output_name; struct wl_list link; + // Dimensions of last wl_buffer committed to background surface + int last_buffer_width, last_buffer_height; }; // There is exactly one swaylock_image for each -i argument |
