Skip to content

fix(windows): grab, grabbing, zoom-in and zoom-out show Chromium's pictures - #2123

Merged
Hona merged 1 commit into
devfrom
cursor/windows-pictures
Nov 25, 2026
Merged

Hona merged 1 commit into
devfrom
cursor/windows-pictures

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

Windows has no system cursor for grab, grabbing, zoom-in or zoom-out. winit's stand-ins (platform_impl/windows/util.rs) are:

request Windows showed
Cursor::Grab, Cursor::Grabbing the four-way move arrows (IDC_SIZEALL)
Cursor::ZoomIn, Cursor::ZoomOut the plain arrow

So a picture that can be dragged read as "move", and a picture that opens larger gave no hint at all. A browser on Windows draws its own pictures for these, which is what an app that follows a web design is compared with.

What changes

On Windows the four shapes draw Chromium's Windows cursors: its 32 px bitmaps (ui/resources/cursors/hand_grab.cur, hand_grabbing.cur, zoom_in.cur, zoom_out.cur) with their hot spots, each pixel doubled into the 2x PNG a CursorImage takes and resampled nearest-neighbour to the monitor's scale. This is the route Cursor::Cell already takes; windows_image now names all five.

The PNGs were made by the conversion that reproduces the cell.png already here from Chromium's cell.cur, pixel for pixel (0 of 628 visible pixels differ).

Cursor::ResizeColumn and Cursor::ResizeRow stay the system's two-way arrows. Chromium's col_resize.cur and row_resize.cur are inverting cursors (every drawn pixel inverts the screen under it), which a colour cursor cannot do.

What it can change for an app

On Windows, an element that asks for Grab, Grabbing, ZoomIn or ZoomOut shows a hand or a magnifier instead of the move arrows or the arrow. The first use of each makes its OS cursor when the loop next sleeps (as an app's own image cursor does). macOS, Linux and the web are unchanged.

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. the_windows_pictures_decode_with_their_hot_spots checks each picture's size, hot spot and 1-bit edges, and that every other shape stays the system's.

…ctures

Windows has no system cursor for them; winit's stand-ins were the four-way move arrows and the plain arrow. Chromium's Windows bitmaps with their hot spots, by the route Cursor::Cell already takes.
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