cocoa: Send a maximized event instead of restored if a deminiaturized window is zoomed

This commit is contained in:
Frank Praznik
2023-08-14 11:00:40 -04:00
parent ddddcb78cb
commit fe85e6e754

View File

@@ -955,8 +955,13 @@ static void Cocoa_SendExposedEventIfVisible(SDL_Window *window)
- (void)windowDidDeminiaturize:(NSNotification *)aNotification - (void)windowDidDeminiaturize:(NSNotification *)aNotification
{ {
/* isZoomed always returns true if the window is not resizable */
if ((_data.window->flags & SDL_WINDOW_RESIZABLE) && [_data.nswindow isZoomed]) {
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_MAXIMIZED, 0, 0);
} else {
SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_RESTORED, 0, 0); SDL_SendWindowEvent(_data.window, SDL_EVENT_WINDOW_RESTORED, 0, 0);
} }
}
- (void)windowDidBecomeKey:(NSNotification *)aNotification - (void)windowDidBecomeKey:(NSNotification *)aNotification
{ {