src/video/cocoa/SDL_cocoamouse.m
changeset 5371 fc3d3d580777
parent 5262 b530ef003506
child 5376 183ec2d4485c
--- a/src/video/cocoa/SDL_cocoamouse.m	Sun Feb 20 23:51:59 2011 -0800
+++ b/src/video/cocoa/SDL_cocoamouse.m	Mon Feb 21 10:50:53 2011 -0800
@@ -49,62 +49,7 @@
 void
 Cocoa_HandleMouseEvent(_THIS, NSEvent *event)
 {
-    int i;
-    NSPoint point = { 0, 0 };
-    SDL_Window *window;
-    SDL_Window *focus = SDL_GetMouseFocus();
-
-    /* See if there are any fullscreen windows that might handle this event */
-    window = NULL;
-    for (i = 0; i < _this->num_displays; ++i) {
-        SDL_VideoDisplay *display = &_this->displays[i];
-        SDL_Window *candidate = display->fullscreen_window;
-
-        if (candidate) {
-            SDL_Rect bounds;
-
-            Cocoa_GetDisplayBounds(_this, display, &bounds);
-            point = [NSEvent mouseLocation];
-            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)) {
-                /* This is it! */
-                window = candidate;
-                break;
-            } else if (candidate == focus) {
-                SDL_SetMouseFocus(NULL);
-            }
-        }
-    }
-
-    if (!window) {
-        return;
-    }
-
-    switch ([event type]) {
-    case NSLeftMouseDown:
-    case NSOtherMouseDown:
-    case NSRightMouseDown:
-        SDL_SendMouseButton(window, SDL_PRESSED, ConvertMouseButtonToSDL([event buttonNumber]));
-        break;
-    case NSLeftMouseUp:
-    case NSOtherMouseUp:
-    case NSRightMouseUp:
-        SDL_SendMouseButton(window, SDL_RELEASED, ConvertMouseButtonToSDL([event buttonNumber]));
-        break;
-    case NSScrollWheel:
-        Cocoa_HandleMouseWheel(window, event);
-        break;
-    case NSLeftMouseDragged:
-    case NSRightMouseDragged:
-    case NSOtherMouseDragged: /* usually middle mouse dragged */
-    case NSMouseMoved:
-        SDL_SendMouseMotion(window, 0, (int)point.x, (int)point.y);
-        break;
-    default: /* just to avoid compiler warnings */
-        break;
-    }
+    /* We're correctly using views even in fullscreen mode now */
 }
 
 void