From b893aebe69bcdf7715d077d23ab07145493bcb0b Mon Sep 17 00:00:00 2001 From: kleuter Date: Sun, 22 Nov 2020 15:57:44 +0100 Subject: [PATCH] 5.15.2: macOS: Account for Big Sur always enabling layer backed views (https://github.com/qt/qtbase/commit/2cae34354bd41ae286258c7a6b3653b746e786ae) --- .../src/plugins/platforms/cocoa/qnsview_drawing.mm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/5.15.2/qtbase/src/plugins/platforms/cocoa/qnsview_drawing.mm b/5.15.2/qtbase/src/plugins/platforms/cocoa/qnsview_drawing.mm index 2fd63fa..537ea2a 100644 --- a/5.15.2/qtbase/src/plugins/platforms/cocoa/qnsview_drawing.mm +++ b/5.15.2/qtbase/src/plugins/platforms/cocoa/qnsview_drawing.mm @@ -73,8 +73,15 @@ // by AppKit at a point where we've already set up other parts of the platform plugin // based on the presence of layers or not. Once we've rewritten these parts to support // dynamically picking up layer enablement we can let AppKit do its thing. - return QMacVersion::buildSDK() >= QOperatingSystemVersion::MacOSMojave - && QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSMojave; + + if (QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSBigSur) + return true; // Big Sur always enables layer-backing, regardless of SDK + + if (QMacVersion::currentRuntime() >= QOperatingSystemVersion::MacOSMojave + && QMacVersion::buildSDK() >= QOperatingSystemVersion::MacOSMojave) + return true; // Mojave and Catalina enable layers based on the app's SDK + + return false; // Prior versions needed explicitly enabled layer backing } - (BOOL)layerExplicitlyRequested