Browse Source

MacOS: Force disable application HiDPI support on NSView, fixes #794

LD 6 years ago
parent
commit
f72c72b36a
1 changed files with 5 additions and 0 deletions
  1. 5 0
      panda/src/cocoadisplay/cocoaGraphicsWindow.mm

+ 5 - 0
panda/src/cocoadisplay/cocoaGraphicsWindow.mm

@@ -549,6 +549,11 @@ open_window() {
     _parent_window_handle->attach_child(_window_handle);
   }
 
+  // Always disable application HiDPI support, Cocoa will do the eventual upscaling for us.
+  // Note: setWantsBestResolutionOpenGLSurface method is supported from MacOS 10.7 onwards
+  if ([_view respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)]) {
+    [_view setWantsBestResolutionOpenGLSurface:NO];
+  }
   if (_properties.has_icon_filename()) {
     NSImage *image = load_image(_properties.get_icon_filename());
     if (image != nil) {