Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed cocoa trying to shuffling windows when going fullscreen on the …
Browse files Browse the repository at this point in the history
…main display.
  • Loading branch information
slouken committed Feb 11, 2011
1 parent 8293760 commit 316dd28
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/video/cocoa/SDL_cocoamodes.m
Expand Up @@ -258,14 +258,23 @@ - (void) setFrame:(NSRect)frame;
/* Restoring desktop mode */
CGDisplaySwitchToMode(displaydata->display, data->moderef);

CGDisplayRelease(displaydata->display);
if (CGDisplayIsMain(displaydata->display)) {
CGReleaseAllDisplays();
} else {
CGDisplayRelease(displaydata->display);
}

if (CGDisplayIsMain(displaydata->display)) {
ShowMenuBar();
}
} else {
/* Put up the blanking window (a window above all other windows) */
result = CGDisplayCapture(displaydata->display);
if (CGDisplayIsMain(displaydata->display)) {
/* If we don't capture all displays, Cocoa tries to rearrange windows... *sigh* */
result = CGCaptureAllDisplays();
} else {
result = CGDisplayCapture(displaydata->display);
}
if (result != kCGErrorSuccess) {
CG_SetError("CGDisplayCapture()", result);
goto ERR_NO_CAPTURE;
Expand Down

0 comments on commit 316dd28

Please sign in to comment.