Skip to content

KColorSchemeWatcherMac: do not use new NSAppearance API on older macOS versions

On macOS versions older than Big Sur (11.0) the NSAppearance.currentDrawingAppearance property does not exist, and trying to use it will crash the app at runtime.

This commit makes sure the new property is used on Big Sur or newer macOS releases, and uses the deprecated NSAppearance.currentAppearance property on Mojave (10.14) or newer. As the light/dark mode switch was introduced in Mojave, running the app on older releases will always prefer the light mode.

Tested on macOS 10.15.5 (x86_64) and 13.1 (arm64)

BUG: 463752

Merge request reports