Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: implement RESIZE_NESW and RESIZE_NWSE cursors #232

Open
tonsky opened this issue Jun 7, 2022 · 2 comments
Open

macOS: implement RESIZE_NESW and RESIZE_NWSE cursors #232

tonsky opened this issue Jun 7, 2022 · 2 comments

Comments

@tonsky
Copy link
Collaborator

tonsky commented Jun 7, 2022

macOS is missing NESW/NWSE right now. I guess the solution here would be to provide custom cursors (I think that’s what both browsers and AWT do), then we can cover all the use-cases

See #231 for context

@LuisThiamNye
Copy link
Contributor

You may be able to access a range of additional cursors using private methods of NSCursor:
https://stackoverflow.com/questions/27242353/cocoa-predefined-resize-mouse-cursor

Also, from the Chromium source, these look relevant:
https://github.com/chromium/chromium/blob/main/ui/base/cocoa/cursor_utils.mm
chromium/chromium@146be2e

Granted I have no real experience with Objective-C, but it appears to me as though Chromium first attempts to use the hidden system cursors by inheriting NSCursor and setting the private field _type. If that fails, a fallback image is used. I think this would be the best approach.

@tonsky
Copy link
Collaborator Author

tonsky commented Jun 28, 2022

Looks great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants