Commit 8b280091058a348e4e94213a4d864267fb740f11

J?rgen P. Tjern? 2014-04-24T21:05:51

Mac: Correct the y-axis position after 870c7d21004b This fixes a bug where we'd offset positions by the height of the dock, if it was along the bottom of the screen. Fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2509 Thanks to Alex Szpakowski for bug & patch.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index f2b2dd6..ba30597 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -92,7 +92,7 @@ static Uint32 s_moveHack;
 static void ConvertNSRect(NSScreen *screen, NSRect *r)
 {
     NSRect visibleScreen = [screen visibleFrame];
-    r->origin.y = visibleScreen.size.height - r->origin.y - r->size.height;
+    r->origin.y = (visibleScreen.origin.y + visibleScreen.size.height) - r->origin.y - r->size.height;
 }
 
 static void