Fix of dark mode detection on macOS 10.12 and 10.13

This commit is contained in:
Lukas Matena 2020-02-27 14:38:39 +01:00
parent dff9af20a4
commit 7759eccf56

View File

@ -332,7 +332,11 @@ unsigned GUI_App::get_colour_approx_luma(const wxColour &colour)
bool GUI_App::dark_mode()
{
#if __APPLE__
return mac_dark_mode();
// The check for dark mode returns false positive on 10.12 and 10.13,
// which allowed setting dark menu bar and dock area, which is
// is detected as dark mode. We must run on at least 10.14 where the
// proper dark mode was first introduced.
return wxPlatformInfo::Get().CheckOSVersion(10, 14) && mac_dark_mode();
#else
const unsigned luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
return luma < 128;