Skip to content

feat(kit): Preview::pan_cursors, to keep the arrow over a zoomed image - #2122

Merged
Hona merged 1 commit into
devfrom
cursor/preview-pan-cursors
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
cursor/preview-pan-cursors

Conversation

@Hona

@Hona Hona commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Compiled

Compiled on Windows x64, Windows arm64, macOS and Linux x64 in anomalyco/opencode-rune#1137, all four build jobs green: the app with Rune pinned to a check commit, the rev the app pins today (4d8df909) plus this change and the five other cursor changes, cherry-picked. That is this change on the app's rev, not on this branch's base (dev is 117 commits past it); every match on Cursor that dev has was checked by reading.

Why

The kit's full-window image preview sets Cursor::Grab on its body when the image is zoomed, and Cursor::Grabbing while it is dragged. It does so after the app's PreviewBind hooks have run, so an app cannot take it back. An app that follows a design where a zoomed image keeps the arrow showed the hand there (and on Windows, where winit has no hand for grab, the four-way move arrows).

What changes

Preview::pan_cursors(bool):

  • On unless set: the open hand over a zoomed image, the closed one while it is dragged.
  • Off: the preview sets no cursor, so the arrow shows, as it does over a fitted image.

Dragging pans either way: the cursor is only the hint.

What it can change for an app

Nothing until an app calls pan_cursors(false).

Not run

The new test has not been run: this repo's tests run on the scheduled macOS job, which I read after the merge. pan_cursors_off_leaves_a_zoomed_image_on_the_arrow covers a fitted image (the arrow in both), and a zoomed one with the cursors on (Grab) and off (the arrow).

The full-window image preview set the grab and grabbing cursors on its body after the app's hooks, so an app could not keep the arrow there. On by default.
@Hona
Hona marked this pull request as ready for review November 25, 2026 05:58
@Hona
Hona merged commit 5b798ad into dev Nov 25, 2026
2 checks passed
@Hona
Hona deleted the cursor/preview-pan-cursors branch November 25, 2026 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant