Skip to content
This repository was archived by the owner on Jan 26, 2026. It is now read-only.

Commit dcbdf09

Browse files
committed
Fixed macOS build
(cherry picked from commit 230f1debd01f395a276329569026274d2eb64551)
1 parent a9b1198 commit dcbdf09

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/video/cocoa/SDL_cocoawindow.m

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -933,13 +933,13 @@ - (void)windowDidChangeScreenProfile:(NSNotification *)aNotification
933933
- (void)windowDidChangeScreen:(NSNotification *)aNotification
934934
{
935935
/*printf("WINDOWDIDCHANGESCREEN\n");*/
936-
#ifdef SDL_VIDEO_OPENGL
936+
#ifdef SDL_VIDEO_OPENGL
937937
if (_data && _data.nscontexts) {
938938
for (SDLOpenGLContext *context in _data.nscontexts) {
939939
[context movedToNewScreen];
940940
}
941941
}
942-
#endif /* SDL_VIDEO_OPENGL */
942+
#endif /* SDL_VIDEO_OPENGL */
943943
}
944944

945945
- (void)windowWillEnterFullScreen:(NSNotification *)aNotification
@@ -2348,6 +2348,10 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window * window)
23482348
SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata);
23492349

23502350
if (data) {
2351+
#ifdef SDL_VIDEO_OPENGL
2352+
NSArray *contexts;
2353+
#endif
2354+
23512355
if ([data.listener isInFullscreenSpace]) {
23522356
[NSMenu setMenuBarVisible:YES];
23532357
}
@@ -2359,15 +2363,13 @@ void Cocoa_DestroyWindow(_THIS, SDL_Window * window)
23592363
[data.nswindow close];
23602364
}
23612365

2362-
#ifdef SDL_VIDEO_OPENGL
2363-
2364-
NSArray *contexts = [data.nscontexts copy];
2366+
#ifdef SDL_VIDEO_OPENGL
2367+
contexts = [data.nscontexts copy];
23652368
for (SDLOpenGLContext *context in contexts) {
23662369
/* Calling setWindow:NULL causes the context to remove itself from the context list. */
23672370
[context setWindow:NULL];
23682371
}
2369-
2370-
#endif /* SDL_VIDEO_OPENGL */
2372+
#endif /* SDL_VIDEO_OPENGL */
23712373

23722374
if (window->shaper) {
23732375
CFBridgingRelease(window->shaper->driverdata);

0 commit comments

Comments
 (0)