Commit graph

3 commits

Author SHA1 Message Date
Zhizhen He
e6561b6337
Respect mouse mappings for link hover feedback
Follow configured mouse actions for the hand pointer and hover underline,
and refresh both on modifier changes without requiring mouse movement.

Cover URL detection, hyperlink highlighting, configuration variants, and
link dragging with focused regression tests.
2026-10-23 05:08:02 +08:00
Kovid Goyal
df999b05e5 Fix drag gesture state leaking past the button event early returns
Follow-ups to the drag_or_normal_select selected text drag support:

- Reset the pending drag at the top of handle_button_event again, before
  the scrollbar, missing screen and mouse position early returns. Moving
  it into a helper placed it after those returns, so a scrollbar track
  click (with scrollbar_jump_on_click disabled) no longer cleared an
  armed URL drag, letting it fire on a later mouse move with no button
  held. Split the helper in two, as arming the drag needs an up to date
  mouse position but clearing it does not.

- Clear the click queue for all drag kinds, not just text drags. A native
  drag consumes mouse-up, so the press lingered and turned the next press
  into a double press, selecting a word instead of starting a new
  gesture. Reproducible with link drags before this change.

- Note that handle_potential_drag can call into Python, which can
  re-alloc the windows array, so w must not be used after it returns.

Also share the drag thumbnail construction between drag_url and
drag_selection (and skip the thumbnail rather than dividing by zero on a
zero width render), use None instead of -1 for the mock event pixel
position so negative positions remain testable, and tighten the
off-by-one bound in clear_click_queue.
2026-09-08 18:51:02 +05:30
白鸽
2cd6733c75 Allow dragging selected text with drag_or_normal_select 2026-09-06 21:16:02 +08:00