From a56b85dbedc68c16d4eb97ce10b7ecc0c0451b0b Mon Sep 17 00:00:00 2001 From: LD Date: Tue, 7 Jan 2020 14:09:05 +0100 Subject: [PATCH] cocoadisplay: Fix switch to fullscreen on macOS 10.9 using current display resolution --- panda/src/cocoadisplay/cocoaGraphicsWindow.mm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index 6f4689bda0..53e5f6f6a2 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -1143,13 +1143,14 @@ find_display_mode(int width, int height) { int refresh_rate; mode = CGDisplayCopyDisplayMode(_display); -#if __MAC_OS_X_VERSION_MAX_ALLOWED < 1080 // First check if the current mode is adequate. - if (CGDisplayModeGetWidth(mode) == width && + // This test not done for macOS 10.15 and above as the mode resolution is + // not enough to identify a mode. + if (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_14 && + CGDisplayModeGetWidth(mode) == width && CGDisplayModeGetHeight(mode) == height) { return mode; } -#endif current_pixel_encoding = CGDisplayModeCopyPixelEncoding(mode); refresh_rate = CGDisplayModeGetRefreshRate(mode);