video: Handle Cocoa desktop mode switch inhibition in the video layer

The X backend had the same issue, so both Cocoa and X can be handled in the same location.
This commit is contained in:
Frank Praznik
2025-03-03 10:50:20 -05:00
parent 24ec2ed785
commit 6c347cbf33
2 changed files with 2 additions and 2 deletions

View File

@@ -1435,7 +1435,7 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
{
SDL_DisplayMode last_mode;
if (display->fullscreen_window) {
if (display->fullscreen_window || display->device->setting_display_mode) {
// This is a temporary mode change, don't save the desktop mode
return;
}

View File

@@ -433,7 +433,7 @@ static void Cocoa_DisplayReconfigurationCallback(CGDirectDisplayID displayid, CG
}
}
if ((flags & kCGDisplaySetModeFlag) && !_this->setting_display_mode) {
if (flags & kCGDisplaySetModeFlag) {
if (display) {
CGDisplayModeRef moderef = CGDisplayCopyDisplayMode(displayid);
if (moderef) {