Restore the desktop mode when requested
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404254
This commit is contained in:
parent
ae0f3ac642
commit
b5fc901837
1 changed files with 18 additions and 9 deletions
|
@ -247,16 +247,25 @@ Cocoa_SetDisplayMode(_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode)
|
||||||
goto ERR_NO_CAPTURE;
|
goto ERR_NO_CAPTURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Do the physical switch */
|
if (data == display->desktop_mode.driverdata) {
|
||||||
result = CGDisplaySwitchToMode(displaydata->display, data->moderef);
|
/* Restoring desktop mode */
|
||||||
if (result != kCGErrorSuccess) {
|
CGDisplayRelease(displaydata->display);
|
||||||
CG_SetError("CGDisplaySwitchToMode()", result);
|
|
||||||
goto ERR_NO_SWITCH;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Hide the menu bar so it doesn't intercept events */
|
if (CGDisplayIsMain(displaydata->display)) {
|
||||||
if (CGDisplayIsMain(displaydata->display)) {
|
ShowMenuBar();
|
||||||
HideMenuBar();
|
}
|
||||||
|
} 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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Fade in again (asynchronously) */
|
/* Fade in again (asynchronously) */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue