Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
macOS: Fix the coordinate space of SDL_GetDisplayUsableBounds (thanks…
- Loading branch information
Showing
with
2 additions
and
6 deletions.
-
+2
−6
src/video/cocoa/SDL_cocoamodes.m
|
@@ -300,13 +300,9 @@ |
|
|
return -1; |
|
|
} |
|
|
|
|
|
const CGRect cgrect = CGDisplayBounds(cgdisplay); |
|
|
const NSRect frame = [screen visibleFrame]; |
|
|
|
|
|
// !!! FIXME: I assume -[NSScreen visibleFrame] is relative to the origin of the screen in question and not the whole desktop. |
|
|
// !!! FIXME: The math vs CGDisplayBounds might be incorrect if that's not the case, though. Check this. |
|
|
rect->x = (int)(cgrect.origin.x + frame.origin.x); |
|
|
rect->y = (int)(cgrect.origin.y + frame.origin.y); |
|
|
rect->x = (int)frame.origin.x; |
|
|
rect->y = (int)(CGDisplayPixelsHigh(kCGDirectMainDisplay) - frame.origin.y - frame.size.height); |
|
|
rect->w = (int)frame.size.width; |
|
|
rect->h = (int)frame.size.height; |
|
|
|
|
|