| Summary: | OS X 10.11 Cmd-Tab not returning to space in SDL_WINDOW_FULLSCREEN_DESKTOP | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Dan Ginsburg <dang> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | amaranth72 |
| Version: | HG 2.1 | ||
| Hardware: | x86_64 | ||
| OS: | Mac OS X (All) | ||
Cross-reference to Dota 2 bug: https://github.com/ValveSoftware/Dota-2/issues/546 This seems to be fixed if the Cocoa code stops trying to set the window level to anything above the 'normal' window level when fullscreen-desktop mode is used. ( https://hg.libsdl.org/SDL/file/b0b12a3c817c/src/video/cocoa/SDL_cocoawindow.m#l1519 , and https://hg.libsdl.org/SDL/file/b0b12a3c817c/src/video/cocoa/SDL_cocoawindow.m#l1604 ) That said, the last time I tried fiddling with what SDL sets the window level to in fullscreen, there were some performance implications. But I think that was before SDL used Spaces for fullscreen-desktop mode, so the performance implications (if any) likely aren't the same now. This should be fixed as of this commit: https://hg.libsdl.org/SDL/rev/b9b4c1bbb778 Thanks Alex! I can confirm this fixed the issue for Dota 2. |
On OS X 10.11 (although not OS X 10.10), when a window is put into SDL_WINDOW_FULLSCREEN_DESKTOP it will create the window in a new space as it should. However, if you Command-Tab out of that window and Command-Tab back, the dock will hide but it will not return to the Space. You can get back to the Space with CTRL->RIGHT or swiping, but users in Dota 2 get confused by this. Reproducing this is super easy, I modified testgl2.c to show the bug. Simply modify testgl2.c to go SDL_WINDOW_FULLSCREEN_DESTKOP as in the code below, then run the app, Command-Tab to the desktop, Command-Tab back to the app and you will see the dock clear but it won't return to the app. This seems to be some sort of behavior change with OS X 10.11 because it doesn't happen in OS X 10.10. diff -r d3ad01d50bf0 test/testgl2.c --- a/test/testgl2.c Wed Oct 07 21:18:08 2015 +0200 +++ b/test/testgl2.c Thu Oct 15 12:44:35 2015 -0400 @@ -362,6 +362,10 @@ } } + //@TEMP + SDL_SetWindowFullscreen( state->windows[0], SDL_WINDOW_FULLSCREEN_DESKTOP ); + //@TEMP + /* Set rendering settings */ ctx.glMatrixMode(GL_PROJECTION); ctx.glLoadIdentity();