summaryrefslogtreecommitdiff
path: root/include/yasl/yasl.h
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-16 14:29:14 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-16 14:29:14 +0300
commit65a5a2f6ffc6f67ffa3d5ee62b3c8979b4c35b7a (patch)
tree8121b7df3506aa955165328522274f8e2b368e21 /include/yasl/yasl.h
parent4b1559a81fe904d66c23d59946ab8b5a2cb3614f (diff)
Report the current geometry in WINDOW eventsHEADmain
During a macOS live resize, the refresh callback ran with the new size while its WINDOW event stayed queued until the drag ended. wsap_term sizes its grid from WINDOW events, so the grid kept its old size until the mouse was released. Every intermediate size then replayed in a burst, since queued resizes were never folded. A WINDOW event now reports the surface's current geometry, so resizes queued while the application was away fold into one, and a size it already has reports nothing. The refresh callback documents that yasl_surface_get_info is current inside it and that one WINDOW event follows once the system's loop returns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'include/yasl/yasl.h')
-rw-r--r--include/yasl/yasl.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h
index 931cf7f..d68bcc9 100644
--- a/include/yasl/yasl.h
+++ b/include/yasl/yasl.h
@@ -81,7 +81,10 @@ struct yasl_surface_options {
void *userdata;
/** Called when the window needs drawing while the system blocks the event
* loop, as during a macOS live resize; draw and present before returning.
- * REFRESH events cover every other case. Must not wait, create or destroy. */
+ * REFRESH events cover every other case. Events stay queued meanwhile, so
+ * apply the size from yasl_surface_get_info, already current here; one
+ * WINDOW event reports the final size once the system's loop returns.
+ * Waiting, creating and destroying fail with EBUSY. */
void (*refresh)(yasl_surface *surface);
struct yasl_gl_options gl;
};
@@ -201,7 +204,9 @@ enum yasl_event_type {
YASL_EVENT_CLOSE, /**< The user asked to close the window; destroy it to comply. */
YASL_EVENT_QUIT, /**< The system asked the app to quit; exit to comply. */
YASL_EVENT_REOPEN, /**< macOS: the app was activated with no window open. */
- YASL_EVENT_WINDOW, /**< window: size, scale or state changed. */
+ YASL_EVENT_WINDOW, /**< window: size, scale or state changed. It reports the
+ * current geometry, so changes made since the last
+ * one fold into it. */
YASL_EVENT_REFRESH, /**< Draw now: once sized, after every resize, and on expose. */
YASL_EVENT_KEY, /**< key; action is a yasl_key_action. */
YASL_EVENT_TEXT, /**< text: typed text to insert. */