diff src/video/cocoa/SDL_cocoamouse.m @ 3528:59ff7a2beb57

Added an API function to query geometry of multiple monitors: SDL_GetDisplayBounds() Implemented multi-monitor window positions on Windows
author Sam Lantinga <slouken@libsdl.org>
date Sun, 06 Dec 2009 08:03:38 +0000
parents 455a6c47d2c6
children 64ce267332c6
line wrap: on
line diff
--- a/src/video/cocoa/SDL_cocoamouse.m	Sun Dec 06 06:21:39 2009 +0000
+++ b/src/video/cocoa/SDL_cocoamouse.m	Sun Dec 06 08:03:38 2009 +0000
@@ -67,12 +67,12 @@
         SDL_Window *candidate = display->fullscreen_window;
 
         if (candidate) {
-            SDL_DisplayData *displaydata = (SDL_DisplayData *)display->driverdata;
-            NSRect rect = Cocoa_DisplayBounds(displaydata->display);
+            SDL_Rect bounds;
 
+            Cocoa_GetDisplayBounds(_this, display, &bounds);
             point = [NSEvent mouseLocation];
-            point.x = point.x - rect.origin.x;
-            point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - rect.origin.y;
+            point.x = point.x - bounds.x;
+            point.y = CGDisplayPixelsHigh(kCGDirectMainDisplay) - point.y - bounds.y;
             if (point.x < 0 || point.x >= candidate->w ||
                 point.y < 0 || point.y >= candidate->h) {
                 /* The mouse is out of this fullscreen display */