diff options
| author | Berke Güzel <wenekar1@gmail.com> | 2026-10-16 13:26:20 +0300 |
|---|---|---|
| committer | Berke Güzel <wenekar1@gmail.com> | 2026-10-16 13:26:20 +0300 |
| commit | 6f017eb4c18ea53cbc2782df10e078f5b939e87c (patch) | |
| tree | 412b145bf1c9adac770a94e5aba2cd34baf3d742 /include | |
| parent | 12d2735115528d741ebf47b6738c88b7c182b85b (diff) | |
End every drag with one eventone-loop
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 <noreply@anthropic.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/yasl/yasl.h | 7 |
1 files changed, 5 insertions, 2 deletions
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 |
