Skip to content

Commit

Permalink
one last SDL fix: restore menu bar if we destroy a fullscreen window …
Browse files Browse the repository at this point in the history
…without transitioning it back to a non-fullscreen window first
  • Loading branch information
slouken committed Nov 9, 2015
1 parent ebfb2ec commit 5103ae9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/video/cocoa/SDL_cocoawindow.m
Expand Up @@ -641,7 +641,11 @@ - (void)windowWillEnterFullScreen:(NSNotification *)aNotification
- (void)windowDidFailToEnterFullScreen:(NSNotification *)aNotification
{
SDL_Window *window = _data->window;


if (window->is_destroying) {
return;
}

SetWindowStyle(window, GetWindowStyle(window));

isFullscreenSpace = NO;
Expand Down Expand Up @@ -688,6 +692,10 @@ - (void)windowDidFailToExitFullScreen:(NSNotification *)aNotification
{
SDL_Window *window = _data->window;

if (window->is_destroying) {
return;
}

SetWindowStyle(window, (NSTitledWindowMask|NSClosableWindowMask|NSMiniaturizableWindowMask|NSResizableWindowMask));

isFullscreenSpace = YES;
Expand Down Expand Up @@ -1648,6 +1656,9 @@ - (void)resetCursorRects
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;

if (data) {
if ([data->listener isInFullscreenSpace]) {
[NSMenu setMenuBarVisible:YES];
}
[data->listener close];
[data->listener release];
if (data->created) {
Expand Down

0 comments on commit 5103ae9

Please sign in to comment.