mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-30 16:45:44 +00:00
libghostty: handle non-monotonic selection times in SelectionGesture
We expect monotonic time but since this is libghostty-exposed we need to be more careful about guarding what we accept. This also practically makes it easier to integrate with various languages. Compare the two instants first and treat backwards timestamps like any other failed repeat. The next press becomes a fresh single-click anchor, and a regression test covers the reset behavior.
This commit is contained in:
@@ -477,7 +477,8 @@ typedef enum GHOSTTY_ENUM_TYPED {
|
||||
* Optional monotonic event time in nanoseconds: uint64_t*.
|
||||
*
|
||||
* If unset, press treats the event as untimed and only single-click behavior
|
||||
* is available.
|
||||
* is available. If a repeat press provides a time earlier than the previous
|
||||
* press, the repeat sequence resets.
|
||||
*/
|
||||
GHOSTTY_SELECTION_GESTURE_EVENT_OPT_TIME_NS = 3,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user