summaryrefslogtreecommitdiff
path: root/src/platform/wayland/internal.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-13 17:12:10 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-13 17:12:10 +0300
commitb7944e4bbfa64a6bb1a1d9e1f172827dde53aed2 (patch)
treed73ff8e368039f67f824ad2dc9130643ef4947ae /src/platform/wayland/internal.h
parentac6f9f5e7711521455b83ceb843a25e091646d43 (diff)
Read back the last presented CPU frame
wsap_term writes PNG screenshots for its debug server and keeps its own copy of the frame because YASL had no readback. yasl_surface_read_pixels() copies the frame from the last successful present, or reports its extent when the buffer is too small. X11 and Cocoa keep it in their single CPU target until the next draw starts; X11 now also forgets it when a resize replaces the target, and Cocoa records the presented extent because a resize can change the size before the next draw. Wayland remembers which buffer it committed and forgets it when a draw reuses that buffer. The backend test checks the copy on Wayland and X11, and that draws that never present do not show through. The Cocoa path is not built or run here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'src/platform/wayland/internal.h')
-rw-r--r--src/platform/wayland/internal.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/platform/wayland/internal.h b/src/platform/wayland/internal.h
index 84a603d..34d4133 100644
--- a/src/platform/wayland/internal.h
+++ b/src/platform/wayland/internal.h
@@ -307,6 +307,8 @@ struct wayland_surface {
int ime_shown_begin, ime_shown_end;
int floating_width, floating_height;
int cur;
+ /* Buffer holding the last presented frame, valid while has_shown is set. */
+ int shown;
int width, height;
int logical_width, logical_height;
int req_width, req_height;
@@ -318,6 +320,7 @@ struct wayland_surface {
/* 1-byte booleans packed tightly */
bool frame_active;
bool frame_presented;
+ bool has_shown;
bool size_pending;
bool sample_refresh;
bool has_pending_serial;