mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-29 01:25:34 +00:00
d4c0f498db
Julian Raschke I use an open Mac laptop with an additional external monitor. The coordinate spaces from SDL_GetGlobalMouseState() and SDL_GetWindowPosition() match on the primary display, but not on the secondary display. Cocoa window coordinates are vertically flipped in relation to the primary display: https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoawindow.m#L219-L222 However, Cocoa_GetGlobalMouseState inverts the cursor Y coordinate per-display: https://github.com/spurious/SDL-mirror/blob/release-2.0.8/src/video/cocoa/SDL_cocoamouse.m#L320-L323 Suggested fix: Replace the for-loop with this simpler calculation: *x = (int) cocoaLocation.x; *y = (int) (CGDisplayPixelsHigh(kCGDirectMainDisplay) - cocoaLocation.y); |
||
---|---|---|
.. | ||
SDL_cocoaclipboard.h | ||
SDL_cocoaclipboard.m | ||
SDL_cocoaevents.h | ||
SDL_cocoaevents.m | ||
SDL_cocoakeyboard.h | ||
SDL_cocoakeyboard.m | ||
SDL_cocoamessagebox.h | ||
SDL_cocoamessagebox.m | ||
SDL_cocoametalview.h | ||
SDL_cocoametalview.m | ||
SDL_cocoamodes.h | ||
SDL_cocoamodes.m | ||
SDL_cocoamouse.h | ||
SDL_cocoamouse.m | ||
SDL_cocoamousetap.h | ||
SDL_cocoamousetap.m | ||
SDL_cocoaopengl.h | ||
SDL_cocoaopengl.m | ||
SDL_cocoaopengles.h | ||
SDL_cocoaopengles.m | ||
SDL_cocoashape.h | ||
SDL_cocoashape.m | ||
SDL_cocoavideo.h | ||
SDL_cocoavideo.m | ||
SDL_cocoavulkan.h | ||
SDL_cocoavulkan.m | ||
SDL_cocoawindow.h | ||
SDL_cocoawindow.m |