From c3708d1ab58bf6ea898ce3f35c6d8de4059034e5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 23 Oct 2009 04:08:32 +0000 Subject: [PATCH] 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 @@) --- src/video/cocoa/SDL_cocoawindow.m | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index a53f6dd82..5f26a50b4 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -233,7 +233,7 @@ - (void)mouseMoved:(NSEvent *)theEvent 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 @@ - (void)mouseMoved:(NSEvent *)theEvent 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) {