From 072e17bf982be19028722db8017b9c5c3e3b1d39 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Thu, 18 Oct 2018 11:59:48 -0400 Subject: [PATCH] cocoa: GL_GetDrawableSize only uses -[NSView convertRectToBacking] for highDPI. On Mojave, this will report large numbers for retina displays in fullscreen mode, which isn't how it works on previous versions. (transplanted from c6c1731780e2bef94f944a4795e2dfbba46d9500) --- src/video/cocoa/SDL_cocoaopengl.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video/cocoa/SDL_cocoaopengl.m b/src/video/cocoa/SDL_cocoaopengl.m index 5f18a2ee8..c7d0c60e5 100644 --- a/src/video/cocoa/SDL_cocoaopengl.m +++ b/src/video/cocoa/SDL_cocoaopengl.m @@ -347,10 +347,12 @@ Cocoa_GL_GetDrawableSize(_THIS, SDL_Window * window, int * w, int * h) NSView *contentView = [windata->nswindow contentView]; NSRect viewport = [contentView bounds]; - /* This gives us the correct viewport for a Retina-enabled view, only - * supported on 10.7+. */ - if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) { - viewport = [contentView convertRectToBacking:viewport]; + if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) { + /* This gives us the correct viewport for a Retina-enabled view, only + * supported on 10.7+. */ + if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) { + viewport = [contentView convertRectToBacking:viewport]; + } } if (w) {