Commit b5fc9018 authored by Sam Lantinga's avatar Sam Lantinga

Restore the desktop mode when requested

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404254
parent ae0f3ac6
......@@ -247,16 +247,25 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
goto ERR_NO_CAPTURE;
}
/* Do the physical switch */
result = CGDisplaySwitchToMode(displaydata->display, data->moderef);
if (result != kCGErrorSuccess) {
CG_SetError("CGDisplaySwitchToMode()", result);
goto ERR_NO_SWITCH;
}
if (data == display->desktop_mode.driverdata) {
/* Restoring desktop mode */
CGDisplayRelease(displaydata->display);
if (CGDisplayIsMain(displaydata->display)) {
ShowMenuBar();
}
} else {
/* Do the physical switch */
result = CGDisplaySwitchToMode(displaydata->display, data->moderef);
if (result != kCGErrorSuccess) {
CG_SetError("CGDisplaySwitchToMode()", result);
goto ERR_NO_SWITCH;
}
/* Hide the menu bar so it doesn't intercept events */
if (CGDisplayIsMain(displaydata->display)) {
HideMenuBar();
/* Hide the menu bar so it doesn't intercept events */
if (CGDisplayIsMain(displaydata->display)) {
HideMenuBar();
}
}
/* Fade in again (asynchronously) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment