JWM icon indicating copy to clipboard operation
JWM copied to clipboard

macOS: implement RESIZE_NESW and RESIZE_NWSE cursors

Open tonsky opened this issue 3 years ago • 2 comments

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

tonsky avatar Jun 07 '22 16:06 tonsky

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 https://github.com/chromium/chromium/commit/146be2e5165365b500fd573769c4fb53343d6276

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.

LuisThiamNye avatar Jun 27 '22 23:06 LuisThiamNye

Looks great!

tonsky avatar Jun 28 '22 13:06 tonsky