src/video/cocoa


Log

Author Commit Date CI Message
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().
Sam Lantinga 704d9bd3 2014-06-25T02:08:37 Fixed bug 2525 - Keyboard focus crash Todd Seiler Call Stack: #0 0x0000000101c29291 in Cocoa_StartTextInput at /Users/Todd/Desktop/codes/sources/SDL/src/video/cocoa/SDL_cocoakeyboard.m:512 #1 0x0000000101c110c5 in SDL_SetKeyboardFocus at /Users/Todd/Desktop/codes/sources/SDL/src/events/SDL_keyboard.c:643 #2 0x0000000101c32be4 in SetupWindowData at /Users/Todd/Desktop/codes/sources/SDL/src/video/cocoa/SDL_cocoawindow.m:981 #3 0x0000000101c32d2a in Cocoa_CreateWindowFrom at /Users/Todd/Desktop/codes/sources/SDL/src/video/cocoa/SDL_cocoawindow.m:1092 #4 0x0000000101c99999 in SDL_CreateWindowFrom_REAL at /Users/Todd/Desktop/codes/sources/SDL/src/video/SDL_video.c:1338 #5 0x0000000101ce1484 in SDL_CreateWindowFrom at /Users/Todd/Desktop/codes/sources/SDL/src/dynapi/SDL_dynapi_procs.h:547 #6 0x0000000100018a5e in SceneRenderer at /Users/Todd/Desktop/codes/sources/tseiler_Todds-MacBook-Pro_3405/AppName/src/SceneRenderer.cpp:138 #7 0x0000000100017ca5 in SceneRenderer at /Users/Todd/Desktop/codes/sources/tseiler_Todds-MacBook-Pro_3405/AppName/src/SceneRenderer.cpp:145 #8 0x000000010000cd96 in App::execute(int, char**) at /Users/Todd/Desktop/codes/sources/tseiler_Todds-MacBook-Pro_3405/AppName/src/App.cpp:28 #9 0x0000000100004402 in main at /Users/Todd/Desktop/codes/sources/tseiler_Todds-MacBook-Pro_3405/AppName/src/main.cpp:8 This issue occurred when using Ogre3D Graphics engine on Mac (cocoa) to create the window. Then handing the window handle off to SDL_CreateWindowFrom(). In Ogre3D application you do the following: window_ = root_->initialise(true, "Ogre Window 2"); loadOgreResources(); Ogre::WindowEventUtilities::addWindowEventListener(window_, this); #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE NSWindow* Data = 0; window_->getCustomAttribute("WINDOW", &Data); sdl_window_ = SDL_CreateWindowFrom((void*)Data); #endif It results in a crash in this function: SDL_cocoakeyboard.m void Cocoa_StartTextInput(_THIS) { SDL_VideoData *data = (SDL_VideoData *) _this->driverdata; NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; SDL_Window *window = SDL_GetKeyboardFocus(); NSWindow *nswindow = nil; if (window) nswindow = ((SDL_WindowData*)window->driverdata)->nswindow; // ... } The crash occurred because "driverdata" was nil. Before this function call, a call to SetupWindowData is called: SDL_cocoawindow.m static int SetupWindowData(_THIS, SDL_Window * window, NSWindow *nswindow, SDL_bool created) { // ... if ([nswindow isKeyWindow]) { window->flags |= SDL_WINDOW_INPUT_FOCUS; SDL_SetKeyboardFocus(data->window); } /* Prevents the window's "window device" from being destroyed when it is * hidden. See http://www.mikeash.com/pyblog/nsopenglcontext-and-one-shot.html */ [nswindow setOneShot:NO]; /* All done! */ [pool release]; window->driverdata = data; return 0; } As you can see: "window->driverdata = data" is performed after the "SDL_SetKeyboardFocus()" call, which eventually leads to "Cocoa_StartTextInput()" where the crash occurs.
Sam Lantinga b7b6d8ab 2014-06-22T02:30:36 Fixed crash initializing OpenGL ES renderer if OpenGL renderer fails
Sam Lantinga 8ef56511 2014-06-21T11:36:00 Fixed compiler warning
Sam Lantinga 6146fe85 2014-06-15T17:18:05 Fixed 2584 - Memory leak in Cocoa_GetDisplayName Diego The Xcode Instruments Leak tool reports a leak from IODisplayCreateInfoDictionary in Cocoa_GetDisplayName. This happened after upgrading to Xcode 5.
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 65133ebc 2014-06-04T09:39:08 Wait for the fullscreen transition to complete before allowing the application to continue. This fixes Alt-Enter in the Steam streaming client, which sets the window size and position immediately after switching out of fullscreen mode.
Sam Lantinga 16360b19 2014-06-04T01:56:14 Fixed escape cancelling fullscreen mode now that the SDL window is the first res ponder.
Sam Lantinga a8fcbc46 2014-06-02T09:09:40 Fixed bug 2534 - Mac: black bar at top of screen in SDL_WINDOW_FULLSCREEN mode Alex Szpakowski Patch to fix the y component of the position of fullscreen windows in OS X. In Mac OS X with the latest Mercurial code, when a window is in exclusive-fullscreen the y component of its position is offset by the same amount that is normally taken up by the menubar, resulting in a black bar at the top of the screen. The recent changes to the internal ConvertNSRect function make it treat the bottom of the menubar as 0 for the y component of window positions, even when the window is fullscreen and 'above' the menubar. I have attached a patch which fixes the issue by only making the window position relative to the menubar in windowed modes.
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.
Sam Lantinga 3905b910 2014-06-02T09:01:10 Fixed bug 2479 - [OS X] SDL_SetWindowFullscreen fails to switch to windowed Eric Wasylishen The problem seems to be the spaces handling code in -setFullscreenSpace: (SDL_cocoawindow.m) is incorrectly reporting that the SDL_WINDOW_FULLSCREEN -> windowed transition has already happened. i.e. I saw this case was getting hit when trying to leave SDL_WINDOW_FULLSCREEN: "else if (state == isFullscreenSpace) { return YES; /* already there. */ }" With the attached patch, both Control+Enter (SDL_WINDOW_FULLSCREEN toggle) and Option+Enter (SDL_WINDOW_FULLSCREEN_DESKTOP toggle) work in an sdl test app (I tried testwm2). Tested on OS X 10.9.2.
Ryan C. Gordon 98c03f39 2014-05-28T01:22:47 Changed drag area API to a hit-testing API. There were several good arguments for this: it's how Windows works with WM_NCHITTEST, SDL doesn't need to manage a list of rects, it allows more control over the regions (how do you use rects to cleanly surround a circular button?), the callback can be more optimized than a iterating a list of rects, and you don't have to send an updated list of rects whenever the window resizes or layout changes.
Ryan C. Gordon 3cbc83ef 2014-05-27T01:27:42 First shot at SDL_SetWindowDragAreas(). Only Cocoa implemented right now.
Ryan C. Gordon ded970f7 2014-05-24T18:23:56 Flip this around to do the simpler condition first.
Ryan C. Gordon 668025c2 2014-05-24T18:23:39 Implement SDL_CaptureMouse() for Mac OS X.
J?rgen P. Tjern? 8b280091 2014-04-24T21:05:51 Mac: Correct the y-axis position after 870c7d21004b This fixes a bug where we'd offset positions by the height of the dock, if it was along the bottom of the screen. Fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2509 Thanks to Alex Szpakowski for bug & patch.
J?rgen P. Tjern? beff5cec 2014-04-19T13:15:53 Mac: SDL_SetWindowPosition is now relative to the menubar. It used to be that SDL_SetWindowPosition was relative to the top of the screen, which didn't make sense. In addition, borderless windows can be positioned *below* the menubar, so SDL_SetWindowPosition(win, 0, 0) on a borderless window would hide ~30ish pixels of the window below the menubar.
J?rgen P. Tjern? fc9e3a69 2014-04-15T13:53:07 Mac: Don't prompt to reopen windows after crash. We don't support state serialization / resume, so disable the prompt that pops up asking if you want to reopen the windows.
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.
Ryan C. Gordon a25bd63c 2014-03-20T16:05:57 Static analysis fix: leaking Objective-C object.
Ryan C. Gordon 84b919a2 2014-03-20T11:22:57 Static analysis fix: dereference of a NULL pointer.
Ryan C. Gordon 1a2a3e9c 2014-03-20T10:04:23 Static analysis fix: Fixed leaking Objective-C object.
Ryan C. Gordon bcc2ed09 2014-03-19T23:19:34 Static analysis fix: bad release. (object is already init'd at this point, so -[obj init] destroys existing reference count.)
Sam Lantinga 9245c930 2014-03-15T16:27:06 Only show the window if it's supposed to be shown.
Ryan C. Gordon c663d731 2014-03-15T15:35:15 Mac: Make sure window is still showing when we exit a fullscreen space.
Sam Lantinga 26e8e387 2014-03-14T18:06:09 Fixed Mac OS X window level when leaving fullscreen mode
Sam Lantinga b677d1d8 2014-03-10T19:59:06 Fixed Mac OS X OpenGL context creation to match other backends, where we only care about the actual version we request if it's 3.0 or newer or a special profile context. Eventually we'll probably move the version checking to higher level code and report the actual version of context that got created, but to avoid breakage we'll leave it like this for now.
Sam Lantinga 28398109 2014-03-10T18:45:07 Fixed regression causing the renderer to recreate its window since it's not getting an OpenGL 2.1 context anymore.
Ryan C. Gordon 9e67444a 2014-03-03T21:25:16 Mac: Added a hint to opt-out of new Spaces code.
Ryan C. Gordon 3889d478 2014-03-02T22:55:12 Removed unused variable.
Ryan C. Gordon 0e5cc8df 2014-03-02T22:51:31 Mac: Don't lose the menu/dock when switching back to a resizable window Space.
Ryan C. Gordon 86be8321 2014-03-02T22:16:49 Mac: only programmatically create Spaces if we're FULLSCREEN_DESKTOP. (coming back from fullscreen in any state is okay).
Ryan C. Gordon 460f97ff 2014-03-02T16:36:40 A bunch of fixes for the new Spaces code.
Sam Lantinga da324233 2014-03-02T13:06:51 Fixed dictionary initialization
Sam Lantinga 0f9bb0cd 2014-03-02T12:58:00 Updated to build on Mac OS X 10.7 with Xcode 4.6
Ryan C. Gordon 5eccbac4 2014-03-02T15:35:24 Mac: Manage menubar and dock as FULLSCREEN_DESKTOP windows become/resign key.
Ryan C. Gordon 51faf449 2014-03-02T12:45:51 Reworked fullscreen policy on Mac OS X. - SDL_WINDOW_FULLSCREEN works as always (change resolution, lock to window). - SDL_WINDOW_FULLSCREEN_DESKTOP now puts the window in its own Space, and hides the menu bar, but you can slide between Spaces and Command-Tab between apps without the window minimizing, etc. - SDL_WINDOW_RESIZABLE windows will get the new 10.7+ "toggle fullscreen" window decoration and menubar item. As far as the app is concerned, this is no different than resizing a window, but it gives the end-user more power. - The hint for putting fullscreen windows into the Spaces system is gone, since Spaces can't enforce the requested resolution. It's a perfect match for FULLSCREEN_DESKTOP, though, so this is all automated now.
Ryan C. Gordon bafa4c7a 2014-03-01T21:33:48 Dynamically load glGetString(), to avoid direct dependency on OpenGL.
Ryan C. Gordon 99583397 2014-03-01T20:46:45 Mac OS X: Make OpenGL context selection more robust, avoid software fallback. Fixes Bugzilla #2197.
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
J?rgen P. Tjern? 95f7e242 2014-02-25T15:28:12 Mac: Immediately update current OpenGL context's shape. Previously we were postponing our -[NSOpenGLContext update] call to the next SDL_GL_SwapWindow, even if the context was current on the current thread. This changes it so that we will do the update immediately if it's the current context. If you're rendering on another thread, you need to call SDL_GL_SwapWindow once after a resize event to ensure your drawable will produce non-garbage data. Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2339
J?rgen P. Tjern? d6b1218b 2014-02-24T16:42:08 Mac: Fix inconsistent repeat of SDL_TEXTINPUT events on 10.7+ Due to the new "tap and hold" IME in Mountain Lion and above, we were getting inconsistent repeat of SDL_TEXTINPUT events. Disabling that functionality (since you can't see the popover anyway) solves this. Bug: https://bugzilla.libsdl.org/show_bug.cgi?id=2387
Sam Lantinga 6bb2f2ef 2014-02-22T17:55:58 Fixed bug 2347 - On OSX, an SDL app prevents system shutdown. Tim McDaniel On OSX, an SDL app forces a system shutdown to be cancelled. This happens because [SDLAppDelegate applicationShouldTerminate] returns NSTerminateCancel. A better approach is to subclass NSApplication and override terminate to do nothing except call SDL_SendQuit. In response to a system shutdown notification, this allows the normal SDL Quit event processing to occur, and if the app then terminates, system shutdown occurs normally. Please see the attached patch, based on SDL 2.0.1.
Sam Lantinga a5f52ac5 2014-02-22T17:32:18 Fixed bug 2395 - OSX: App name in the menu bar is not localized. Tim McDaniel On OSX, the app name in the menu bar is not localized. This can be fixed using the following implementation for GetApplicationName in SDL_cocoaevents.m: static NSString * GetApplicationName(void) { NSDictionary *dict; NSString *appName = 0; appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"]; if (!appName) appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"]; if (![appName length]) appName = [[NSProcessInfo processInfo] processName]; return appName; }
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??
J?rgen P. Tjern? 366b1727 2014-01-29T18:37:23 Mac: [NSApp keyWindow] is not valid in windowDidBecomeKey: This fixes weird behavior on Mac where our first responder reverts to the window itself, rather than the SDLTranslatorResponder, after the window has lost focus once. This causes Escape to call cancelOperation: on the NSWindow, which by default removes our fullscreen-ness. When someone has turned off SDL_TEXTINPUT we should probably set another initial responder that handles the Escape behavior, so that SDL_TEXTINPUT doesn't change fullscreen behavior (and possibly other behavior) like it does now.
J?rgen P. Tjern? bc92383e 2014-01-15T11:31:56 Mac: Don't give windows focus back when we're closing them. Fixes bug #1840 (https://bugzilla.libsdl.org/show_bug.cgi?id=1840)
J?rgen P. Tjern? 8f660a46 2014-01-14T17:33:24 Mac: Trigger SDL_FINGERUP for all touches. Fixes bug #2348. Thanks to Alex Szpakowski for the patch!
Sam Lantinga 27779311 2013-12-27T10:18:11 Bump SDL to build with 10.7 SDK. This also bumps the minimum requirement for building SDL to 10.7, and removes some checking we no longer need. CR: saml
Sam Lantinga 44afc2a3 2013-12-06T16:12:18 Fixed crash if no window has keyboard focus
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.
Sam Lantinga a3bb007e 2013-11-23T02:02:29 Fixed double-free of the window shape path
Sam Lantinga 9dd923fb 2013-11-16T21:19:16 When the mouse is grabbed it's constrained to the client area, not the window frame.
Sam Lantinga 4295a92f 2013-11-14T22:26:49 Fixed bug 2240 - On OS/X after calling SDL_SetWindowBordered right mouse clicks no longer register philhassey On OS/X after calling SDL_SetWindowBordered right mouse clicks no longer register. Steps to Reproduce: 1. Open a windowed window on OS/X. (With the border on.) 2. e.button.button will give values 1,2,3 depending on which mouse button I click. 3. Call SDL_SetWindowBordered to disable the border. 4. e.button.button will only give values 1,2. 3 (right mouse button) stops coming through. Expected result: I expect all mouse buttons to register.
Sam Lantinga 12961352 2013-11-12T02:04:12 Fixed build error with SDK < 10.7
Sam Lantinga 253b9ba8 2013-11-12T02:02:12 We still want to generally minimize on focus loss, but not when we're in a fullscreen space on Mac OS X.
Sam Lantinga 75145ea0 2013-11-12T01:52:54 Added a hint SDL_HINT_VIDEO_FULLSCREEN_SPACES to specify that windows go fullscreen into their own spaces on Mac OS X.
Sam Lantinga 5f8a0b18 2013-11-12T00:32:29 Fullscreen space naming cleanup to avoid confusion with normal fullscreen mode
Sam Lantinga 7459b159 2013-11-11T23:42:43 Made sure the window had the correct border when manually being brought back from fullscreen mode.
Sam Lantinga cb190b82 2013-11-11T22:43:05 Fixed assertion when quickly toggling from fullscreen back to fullscreen: "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'backgroundWindows not nil in enterFullScreenTransitionWithOptions:animated:activatingIt:'" To reproduce this, run testsprite2, press Alt-Enter once, again while it's animating to fullscreen, and then again while it's animating out of fullscreen.
Sam Lantinga 8f8070db 2013-11-11T21:38:11 Fixed window resizing when entering and leaving fullscreen mode
Sam Lantinga 7cf76ffb 2013-11-11T21:21:18 Fixed assertion failure when minimizing a fullscreen window.
Sam Lantinga cb31a80d 2013-11-11T20:42:59 Properly handle toggling fullscreen state when another fullscreen state change is in progress.
Sam Lantinga f0692d65 2013-11-11T03:29:11 Fixed compiling with older Mac OS X SDK
Sam Lantinga 4c1322f6 2013-11-11T02:53:00 Added support for new style fullscreen transitions on Mac OS X
Sam Lantinga 893afbaf 2013-11-10T19:19:44 Fixed pool memory leak
Sam Lantinga b30e396b 2013-11-10T17:56:07 Fixed bug 1965 - Mac: dead code for supporting OS 10.4 Alex Szpakowski The new patch removes all the truly obsolete code I could find. I tested on OS 10.8 and OS 10.5.
Sam Lantinga 5821466c 2013-11-10T17:40:35 Fixed bug 2176 - SDL_CreateWindow(w=INT_MAX, h=INT_MAX) causes program to hang Catch exceptions generated when trying to create a Cocoa window.
Sam Lantinga faebe94c 2013-11-08T14:05:08 Mac: Fix a crash with SDL_MAC_NO_SANDBOX. When we get a kCGEventTapDisabledByTimeout or kCGEventTapDisabledByUserInput, the event tap would perform an invalid memory access. void pointers are so fun. This code only runs if you explicitly build with SDL_MAC_NO_SANDBOX.
Sam Lantinga 621c7f8f 2013-11-08T14:04:51 Added SDL_HINT_CTRL_CLICK_EMULATE_RIGHT_CLICK hint which controls whether ctrl+click should emulate a right click on OSX.
Philipp Wiesemann 0f8d9995 2013-11-02T11:42:00 Corrected typo in source comment.
Ryan C. Gordon d36c7363 2013-10-28T22:43:39 Updated GL version tests for Mac OS X 10.9 ("Mavericks"). They changed the name of their GL 3.2 enum, added the GL 4.1 core profile.
Sam Lantinga bcf5472d 2013-10-21T02:37:03 Fixed bug 2073 - Mac: window moves unexpectedly when exiting SDL_WINDOW_FULLSCREEN_DESKTOP mode Alex Szpakowski In Mac OS X, when SDL_SetWindowFullscreen(window, 0) is called on a window which was in SDL_WINDOW_FULLSCREEN_DESKTOP mode, its original size is restored but its position is moved to the bottom of the screen. I tracked down the issue to these two lines: http://hg.libsdl.org/SDL/file/fdd5cc9e9f90/src/video/cocoa/SDL_cocoawindow.m#l1034 I believe [nswindow setFrameOrigin:rect.origin] implicitly calls [nswindow constrainFrameRect:rect toScreen:screen], which will attempt to constrain the window to the screen, but at that point the window size is still full-screen rather than the restored window size, so the constrainFrameRect function operates on the wrong window size. https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWindow_Class/Reference/Reference.html#//apple_ref/occ/instm/NSWindow/constrainFrameRect:toScreen: I resolved the issue by swapping the order of the function calls, like so: [nswindow setContentSize:rect.size]; [nswindow setFrameOrigin:rect.origin];
Sam Lantinga f5fa492e 2013-10-20T20:42:55 Added a macro SDL_TICKS_PASSED() to correctly compare two 32-bit tick values. Went through the code and used the macro and fixed a couple places that were using incorrect timestamp comparisons.
Sam Lantinga 6435a82d 2013-10-14T09:12:30 Backed out revision fb5ab0e91c56, the platform specific messagebox functions don't have the right prototype since they're designed to be used standalone.
J?rgen P. Tjern? 2568a367 2013-10-07T16:01:40 Mac: Better handling when someone else is the app delegate.
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.
Sam Lantinga 69a4351e 2013-09-30T22:35:32 Fixed bug 2121 - GCC throws error on SDL_FORCE_INLINE when compiling with -ansi
Edward Rudd 869a7076 2013-09-20T13:43:00 add in High DPI support (aka Retina) - based on J?rgen's patch with a few bug fixes
Ryan C. Gordon bfe1b1d0 2013-09-14T01:30:57 Don't incorrectly report success for negative swap intervals on Mac OS X.
Sam Lantinga 67c02a28 2013-09-13T17:42:31 Mac: Translate Ctrl-Left click to right click.
Sam Lantinga e231d5b4 2013-09-13T17:41:17 Mac: Turn off momentum-based scrolling.
Sam Lantinga 37509cf3 2013-09-13T17:40:41 Mac: Fix cast warning.
Sam Lantinga e07d7e64 2013-08-29T08:30:21 Christoph Mallon: Replace strlen(x) == 0 (O(n)) by x[0] == '\0' (O(1)).
Sam Lantinga f79fc33a 2013-08-29T08:29:21 Christoph Mallon: Remove pointless if (x) before SDL_free(x)
J?rgen P. Tjern? 14bf230d 2013-08-12T11:09:13 Mac: Fix restoring of Cmd-H-hidden fullscreen desktop windows. This should fix http://bugzilla.libsdl.org/show_bug.cgi?id=1996
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.
Sam Lantinga 1df1e696 2013-07-14T11:28:44 Added the platform specific messagebox function to the video function list