From 79081a178f077f0475a256be773ba4189d4fd666 Mon Sep 17 00:00:00 2001
From: Frank Praznik <[EMAIL REDACTED]>
Date: Thu, 20 Mar 2025 22:12:42 -0400
Subject: [PATCH] cocoa: Fix zoom check when leaving fullscreen
Non-resizable windows will always report as zoomed, so isZoomed is not a reliable check here.
---
src/video/cocoa/SDL_cocoawindow.m | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 6a031e8bcec67..c164f15f2e392 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -1504,9 +1504,10 @@ when returning to windowed mode from a space (instead of using a pending
if ([self windowOperationIsPending:PENDING_OPERATION_ZOOM]) {
[self clearPendingWindowOperation:PENDING_OPERATION_ZOOM];
[nswindow zoom:nil];
+ _data.was_zoomed = !_data.was_zoomed;
}
- if (![nswindow isZoomed]) {
+ if (!_data.was_zoomed) {
// Apply a pending window size, if not zoomed.
NSRect rect;
rect.origin.x = _data.pending_position ? window->pending.x : window->floating.x;