mirror of
https://github.com/Ryujinx/SDL.git
synced 2025-11-05 21:04:52 +00:00
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]; |
||
|---|---|---|
| .. | ||
| atomic | ||
| audio | ||
| core | ||
| cpuinfo | ||
| events | ||
| file | ||
| filesystem | ||
| haptic | ||
| input/evdev | ||
| joystick | ||
| libm | ||
| loadso | ||
| main | ||
| power | ||
| render | ||
| stdlib | ||
| test | ||
| thread | ||
| timer | ||
| video | ||
| SDL.c | ||
| SDL_assert.c | ||
| SDL_assert_c.h | ||
| SDL_error.c | ||
| SDL_error_c.h | ||
| SDL_hints.c | ||
| SDL_log.c | ||