mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-01 23:07:45 +08:00
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.
(cherry picked from commit 6c347cbf33)
This commit is contained in:
@@ -1435,7 +1435,7 @@ void SDL_SetDesktopDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode
|
|||||||
{
|
{
|
||||||
SDL_DisplayMode last_mode;
|
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
|
// This is a temporary mode change, don't save the desktop mode
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -433,7 +433,7 @@ static void Cocoa_DisplayReconfigurationCallback(CGDirectDisplayID displayid, CG
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & kCGDisplaySetModeFlag) && !_this->setting_display_mode) {
|
if (flags & kCGDisplaySetModeFlag) {
|
||||||
if (display) {
|
if (display) {
|
||||||
CGDisplayModeRef moderef = CGDisplayCopyDisplayMode(displayid);
|
CGDisplayModeRef moderef = CGDisplayCopyDisplayMode(displayid);
|
||||||
if (moderef) {
|
if (moderef) {
|
||||||
|
|||||||
Reference in New Issue
Block a user