From 6f017eb4c18ea53cbc2782df10e078f5b939e87c Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Fri, 16 Oct 2026 13:26:20 +0300 Subject: End every drag with one event A drag that dropped on no YASL surface, such as one dropped on the desktop or canceled, ended unheard: the public drag start set no end listener. An application then waited for the drag's end forever. The public layer now listens for the end. When no surface got the drop, the origin gets DRAG with the new action YASL_DROP_CANCEL. Co-Authored-By: Claude Opus 5.5 --- include/yasl/yasl.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'include/yasl') diff --git a/include/yasl/yasl.h b/include/yasl/yasl.h index 6139bc3..931cf7f 100644 --- a/include/yasl/yasl.h +++ b/include/yasl/yasl.h @@ -216,7 +216,9 @@ enum yasl_event_type { YASL_EVENT_CLIPBOARD, /**< text; action is a yasl_transfer. */ YASL_EVENT_DROP, /**< External data: x, y; action is a yasl_drop_action; * text on RELEASE is a text/uri-list. */ - YASL_EVENT_DRAG, /**< A yasl_drag_start drag: x, y; action is a yasl_drop_action. */ + YASL_EVENT_DRAG, /**< A yasl_drag_start drag: x, y; action is a yasl_drop_action. + * Each drag ends once: RELEASE on the surface it drops on, + * or CANCEL on its origin when it ends anywhere else. */ /** The display server went away; action is a yasl_lost. Before the next * wait, or before returning to the loop, destroy Vulkan surfaces and detach * GL contexts on every thread; popups close. On RECONNECTING, DISPLAY_RESTORED @@ -239,7 +241,8 @@ enum yasl_pen_axis { enum yasl_scroll_source { YASL_SCROLL_UNKNOWN, YASL_SCROLL_WHEEL, YASL_SCROLL_FINGER, YASL_SCROLL_CONTINUOUS }; enum yasl_scroll_phase { YASL_SCROLL_PHASE_NONE, YASL_SCROLL_BEGIN, YASL_SCROLL_UPDATE, YASL_SCROLL_END }; enum yasl_transfer { YASL_TRANSFER_OK, YASL_TRANSFER_UNAVAILABLE, YASL_TRANSFER_FAILED }; -enum yasl_drop_action { YASL_DROP_OVER, YASL_DROP_LEAVE, YASL_DROP_RELEASE }; +/** CANCEL ends a drag that dropped on no YASL surface, or was canceled; x and y are 0. */ +enum yasl_drop_action { YASL_DROP_OVER, YASL_DROP_LEAVE, YASL_DROP_RELEASE, YASL_DROP_CANCEL }; enum yasl_lost { YASL_LOST_RECONNECTING, YASL_LOST_FINAL }; /** Physical key, layout labels (codepoint unshifted, shifted; 0 if none) and the -- cgit v1.2.3