src/video/cocoa/SDL_cocoamouse.m


Log

Author Commit Date CI Message
Sam Lantinga d1cc47b3 2014-08-17T15:07:00 Fixed 2680 - OSX: Replace NSAutoreleasePool with @autoreleasepool Tim McDaniel This patch replaces all use of NSAutoreleasePool with the Apple recommended @autoreleasepool. @autoreleasepool is supposedly more efficient, and since it is scope based it can't be accidentally not released.
Sam Lantinga 5e501804 2014-08-17T14:57:52 Fixed bug 2655 - OSX: Window position and global mouse coord spaces are different Tim McDaniel On OSX, with revision 8729, the coordinate space for window position and the coordinate space for global mouse position don't match. For a non-fullscreen window, the window position is global relative to the bottom of the menubar. The global mouse position is relative to the top of the screen. This affects Cocoa_WarpMouse and potentially other things as well. Further, the coordinate system for window position is now affected by what screen it is on. For example, if I have two equal size screens oriented side by side such that the tops of the screens are equal in global space, with the menubar on one screen, and a window straddles the two screens, the window's y position makes no sense. The window's y position depends on what screen "most" of the window is on. So if I move the window horizontally just a bit, the y position of my window is now different by the size of the menubar, even though the window was not moved vertically. I'd like to reiterate that this was a fairly fundamental change (and a breaking change for us). If SDL OSX is to really support multi-display configurations, this is especially problematic. If the real concern is preventing windows from going under the menubar, then perhaps a solution involving something like overriding [NSWindow constrainFrameRect] would be less problematic than redefining the global window coord space for the main display.
Sam Lantinga fc4e798d 2014-07-07T12:48:25 Fixed bug 2631 - Mac: minor code cleanup Alex Szpakowski Some minor changes to the Mac-specific backend code: - Fixed up some code style issues (mostly brace style inconsistencies). - Fixed a compiler warning in SDL_cocoaevents.m. - Removed some useless code now that the 10.7 SDK is required to build SDL. - Removed Gestalt(gestaltSystemVersion, ...) call and switched to NSAppKitVersionNumber for version checking code. Using Gestalt with gestaltSystemVersion will give 0x1090 in Mac OS 10.10+, and the whole Gestalt function was deprecated in Mac OS 10.8.
Ryan C. Gordon b29740b8 2014-06-25T17:06:12 Merged Ryan's SDL-gui-backend branch. Adds three APIs, and implements them on X11, Cocoa, and Windows: - SDL_CaptureMouse() - SDL_GetGlobalMouseState() - SDL_SetWindowHitTest()
Ryan C. Gordon 84369567 2014-06-25T16:16:55 Changed SDL_GetAbsoluteMouseState() to SDL_GetGlobalMouseState(). This matches naming conventions in the main repository, between SDL_GetRelativeMouseState() and SDL_WarpMouseGlobal().
Ryan C. Gordon 39bad809 2014-06-15T11:59:16 Mac: Fixed crash when returning from a fullscreen Space on shutdown.
Ryan C. Gordon 2cce7b2e 2014-06-11T00:40:19 Implemented Cocoa GetAbsoluteMouseState().
Sam Lantinga 1e00c03f 2014-06-04T10:56:17 Fixed Mac OS X build
Sam Lantinga 45ed5ee4 2014-06-04T10:55:26 Added an API function to warp the mouse cursor in global screen space: SDL_WarpMouseGlobal()
Sam Lantinga 6b90d7f5 2014-06-02T09:06:38 Fixed bug 2550 - [OS X 10.9] Enabling SDL_WINDOW_FULLSCREEN after relative mouse mode leaves cursor visible Eric Wasylishen Steps to reproduce: - Run testwm2 app in the SDLTest Xcode project - Press Control+R to enable relative mouse mode. The mouse cursor should disappear. - Press Control+Enter to enter fullscreen. - Expected: a black screen with no cursor visible. Observed: a black screen, but the mouse cursor is visible in the middle of the screen. It doesn't move when I move the mouse. Reproduced with latest sdl2 hg (changeset f6010ead184f) on OS X 10.9.2. Can't reproduce the problem on OS X 10.6.8 or 10.7.5. I'm speculating that this really an Apple bug.. but anyway, the attached workaround seems to fix it for me, and I think it's fairly safe. A more obvious idea, sticking a call SDL_SetCursor(NULL) at the end of Cocoa_SetWindowFullscreen, didn't work.
Ryan C. Gordon 668025c2 2014-05-24T18:23:39 Implement SDL_CaptureMouse() for Mac OS X.
David Ludwig 3dcb451f 2014-04-09T21:29:19 Added a README file regarding WinRT support To note, this file is currently formatted with CRLF line endings, rather than LF, to allow the file to be viewed with Notepad.
J?rgen P. Tjern? 0d5957df 2014-02-26T16:27:03 Mac: Forgot return value in last commit.
J?rgen P. Tjern? dd94c5fa 2014-02-26T16:10:52 Mac: Don't disassociate cursor if window is moving / doesn't have focus. Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396
J?rgen P. Tjern? 4850d259 2014-02-26T11:35:02 Mac: Redo cursor warp handling. This fixes bugs related to getting unnaturally large xrel/yrel for SDL_MOUSEMOTION after warps and enabling / disabling relative mode. Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=1836
J?rgen P. Tjern? 52a63e82 2014-02-25T17:27:41 Mac: Improve moving relative mode windows. This makes it possible to move windows by their title bar, even if they're in relative mode, if you click the title bar when the window does not have focus. Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2396
Sam Lantinga af0ab490 2014-02-22T14:57:12 Fixed bug 2346 - Mac: mousewheel events have flipped horizontal scroll values Alex Szpakowski On my Mac OS X system (10.9.1), the SDL_MOUSEWHEEL event reports negative X values when my trackpad scrolls to the right, and positive X values when my trackpad scrolls to the left. This is backwards from what I'd expect, and I don't think it matches the Windows wheel events. The vertical scroll values are what I'd expect though, and are consistent what gets reported on Windows (positive Y for scrolling up, negative Y for scrolling down.) This is with "scroll direction: natural" disabled in the OS X trackpad settings (i.e. my scroll direction in non-SDL OS X programs matches what happens in Windows and Linux.) I also tested with the horizontal scroll on a real mouse (Logitech G500 without custom drivers), and the horizontal scroll values in SDL are still flipped. I "solved" the issue for myself by changing this line in the Cocoa_HandleMouseWheel function: float x = [event deltaX]; to this: float x = -[event deltaX]; I believe it should work fine with that change - I found something similar in another codebase while looking online for my issue - but I haven't tested on anything below Mac OS 10.8.
Sam Lantinga 58edac3e 2014-02-02T00:53:27 Fixed bug 2374 - Update copyright for 2014... Is it that time already??
Gabriel Jacobo f848adff 2013-11-29T10:06:08 Improve Android pause/resume behavior.
Ryan C. Gordon 7e1289af 2013-11-24T23:56:17 Make internal SDL sources include SDL_internal.h instead of SDL_config.h The new header will include SDL_config.h, but allows for other global stuff.
J?rgen P. Tjern? c455f729 2013-10-07T14:16:38 Fix SDL_SetWindowPosition on fullscreen windows. This reverts http://hg.libsdl.org/SDL/rev/7cdeb64faa72 and fixes it in the correct way. If you call SDL_SetWindowPosition on a fullscreen window, it would update the x & y variables for the window, but not actually move the window (since it was fullscreen). That would make the internal state of the SDL_Window incorrect, causing SDL_WarpMouseInWindow to offset incorrectly. This makes it so SDL_SetWindowPosition updates the `windowed' x & y coordinates, which take effect when you revert from fullscreen.
Gabriel Jacobo dad42067 2013-08-12T11:13:50 Fixes #2022, do not resume on Android when surfaceChanged If the app is in landscape mode and the user presses the power button, a pause is followed immediately by a surfaceChanged event because the lock screen is shown in portrait mode. This triggers a "false" resume. So, we just pause and resume following the onWindowFocusChanged events. Also, wait for SDL_APP_WILLENTERBACKGROUND and SDL_APP_DIDENTERBACKGROUND before blocking the event pump.
Sam Lantinga 1ad936eb 2013-08-11T19:56:43 Fixed bug 2027 - Full-screen appears to be broken - hang in SDL_DestroyWindow() Rainer Deyke I'm running Linux Mint 15 with the Cinnamon window manager. SDL_DestroyWindow consistently locks up for me when the window if fullscreen.