Skip to content

Commit

Permalink
cocoadisplay: Fix regression introduced by 45461e6
Browse files Browse the repository at this point in the history
Closes #829
  • Loading branch information
el-dee authored and rdb committed Jan 5, 2020
1 parent 8137bea commit f68604a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions panda/src/cocoadisplay/cocoaGraphicsWindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1131,7 +1131,9 @@
}
#endif
CFArrayRef modes = CGDisplayCopyAllDisplayModes(_display, options);
CFRelease(options);
if (options != NULL) {
CFRelease(options);
}

size_t num_modes = CFArrayGetCount(modes);
CGDisplayModeRef mode;
Expand Down Expand Up @@ -1166,12 +1168,12 @@

// As explained above, we want to select the fullscreen display mode using
// the same scaling factor, but only for MacOS 10.15+ To do this we check
// the mode width and heightbut also actual pixel widh and height.
// the mode width and height but also actual pixel widh and height.
if (CGDisplayModeGetWidth(mode) == width &&
CGDisplayModeGetHeight(mode) == height &&
CGDisplayModeGetRefreshRate(mode) == refresh_rate &&
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
(floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_14 ||
(floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_14 ||
(CGDisplayModeGetPixelWidth(mode) == expected_pixel_width &&
CGDisplayModeGetPixelHeight(mode) == expected_pixel_height)) &&
#endif
Expand Down

0 comments on commit f68604a

Please sign in to comment.