aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-01-09 15:34:34 +0100
committerDrew DeVault <sir@cmpwn.com>2020-01-09 07:41:50 -0700
commite6fd880686a1bec793eef16cd502ba41bde9a64e (patch)
tree88f3eb87c3a987597f9d7e3a8085354eb3c387ee /include
parentb5cb6de2328c379d73ac4bf0f71d326fa48d6c56 (diff)
backend/wayland: listen to wl_buffer.release events
Previously, we just assumed submitting a new frame would make the compositor release the current one. This isn't always the case, for instance Sway retains old buffers when a transaction is pending. This resulted in synchronization issues with clients writing in front-buffers. Fix this by un-referencing a wlr_buffer when the parent compositor sends wl_buffer.release. Tested by running a fullscreen mpv instance in Sway with the Wayland backend.
Diffstat (limited to 'include')
-rw-r--r--include/backend/wayland.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/backend/wayland.h b/include/backend/wayland.h
index 0bd4a617..4e666c3a 100644
--- a/include/backend/wayland.h
+++ b/include/backend/wayland.h
@@ -47,6 +47,11 @@ struct wlr_wl_backend {
struct wlr_drm_format_set linux_dmabuf_v1_formats;
};
+struct wlr_wl_buffer {
+ struct wlr_buffer *buffer;
+ struct wl_buffer *wl_buffer;
+};
+
struct wlr_wl_presentation_feedback {
struct wlr_wl_output *output;
struct wl_list link;
@@ -67,8 +72,7 @@ struct wlr_wl_output {
struct zxdg_toplevel_decoration_v1 *zxdg_toplevel_decoration_v1;
struct wl_egl_window *egl_window;
EGLSurface egl_surface;
- struct wl_buffer *pending_wl_buffer, *current_wl_buffer;
- struct wlr_buffer *current_buffer;
+ struct wlr_wl_buffer *pending_buffer;
struct wl_list presentation_feedbacks;
uint32_t enter_serial;