Repository navigation
fix(windows): grab, grabbing, zoom-in and zoom-out show Chromium's pictures - #2123
Merged
Merged
Conversation
…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.
This was referenced Nov 25, 2026
Hona
marked this pull request as ready for review
November 25, 2026 05:59
This was referenced Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 (devis 117 commits past it); everymatchonCursorthatdevhas was checked by reading.Why
Windows has no system cursor for
grab,grabbing,zoom-inorzoom-out. winit's stand-ins (platform_impl/windows/util.rs) are:Cursor::Grab,Cursor::GrabbingIDC_SIZEALL)Cursor::ZoomIn,Cursor::ZoomOutSo 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 aCursorImagetakes and resampled nearest-neighbour to the monitor's scale. This is the routeCursor::Cellalready takes;windows_imagenow names all five.The PNGs were made by the conversion that reproduces the
cell.pngalready here from Chromium'scell.cur, pixel for pixel (0 of 628 visible pixels differ).Cursor::ResizeColumnandCursor::ResizeRowstay the system's two-way arrows. Chromium'scol_resize.curandrow_resize.curare 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,ZoomInorZoomOutshows 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_spotschecks each picture's size, hot spot and 1-bit edges, and that every other shape stays the system's.