# HG changeset patch # User Sam Lantinga # Date 1256270912 0 # Node ID 1e45c3012a4fd56713833c43fef11a31ba93bf1e # Parent 4b1f10cfd304b942bdc01f65827309dd5fa81be5 Adam Strzelecki to SDL I think something is wrong (look at the fix patch below): (1) NSRect rect shouldn't be initialized with contentRectForFrameRect: at the top of the function, contentRectForFrameRect is called in non-fullscreen case anyway (1st @@) (2) I think you've left two lines that should be removed completely (2nd @@) diff -r 4b1f10cfd304 -r 1e45c3012a4f src/video/cocoa/SDL_cocoawindow.m --- a/src/video/cocoa/SDL_cocoawindow.m Fri Oct 23 03:58:23 2009 +0000 +++ b/src/video/cocoa/SDL_cocoawindow.m Fri Oct 23 04:08:32 2009 +0000 @@ -233,7 +233,7 @@ int index; SDL_Mouse *mouse; NSPoint point; - NSRect rect = [_data->window contentRectForFrameRect:[_data->window frame]]; + NSRect rect; index = _data->videodata->mouse; mouse = SDL_GetMouse(index); @@ -242,14 +242,12 @@ if ( (window->flags & SDL_WINDOW_FULLSCREEN) ) { rect.size.width = CGDisplayPixelsWide(kCGDirectMainDisplay); rect.size.height = CGDisplayPixelsHigh(kCGDirectMainDisplay); + point.x = point.x - rect.origin.x; point.y = rect.size.height - point.y; } else { rect = [_data->window contentRectForFrameRect:[_data->window frame]]; - point.x = point.x - rect.origin.x; point.y = rect.size.height - (point.y - rect.origin.y); } - point.x = point.x - rect.origin.x; - point.y = rect.size.height - (point.y - rect.origin.y); if ( point.x < 0 || point.x >= rect.size.width || point.y < 0 || point.y >= rect.size.height ) { if (mouse->focus != 0) {