src/video/cocoa/SDL_cocoamouse.m
changeset 3528 59ff7a2beb57
parent 3525 455a6c47d2c6
child 3685 64ce267332c6
--- 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 */