Bug 1042625 - High contrast mode detection broken on Windows <8. r=jimm, a=lmandel
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 24 Jul 2014 14:28:00 +0100
changeset 208226 19d074395f1a
parent 208225 aa124023125a
child 208227 b7316976ca8b
push id3782
push userryanvm@gmail.com
push date2014-08-04 16:21 +0000
treeherdermozilla-beta@e61371be0f38 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, lmandel
bugs1042625
milestone32.0
Bug 1042625 - High contrast mode detection broken on Windows <8. r=jimm, a=lmandel
widget/windows/nsUXThemeData.cpp
--- a/widget/windows/nsUXThemeData.cpp
+++ b/widget/windows/nsUXThemeData.cpp
@@ -289,29 +289,29 @@ void
 nsUXThemeData::UpdateNativeThemeInfo()
 {
   // Trigger a refresh of themed button metrics if needed
   sTitlebarInfoPopulatedThemed = !IsVistaOrLater();
 
   sIsDefaultWindowsTheme = false;
   sThemeId = LookAndFeel::eWindowsTheme_Generic;
 
-  if (!IsAppThemed()) {
-    sThemeId = LookAndFeel::eWindowsTheme_Classic;
-    return;
-  }
-
   HIGHCONTRAST highContrastInfo;
   highContrastInfo.cbSize = sizeof(HIGHCONTRAST);
   if (SystemParametersInfo(SPI_GETHIGHCONTRAST, 0, &highContrastInfo, 0)) {
     sIsHighContrastOn = ((highContrastInfo.dwFlags & HCF_HIGHCONTRASTON) != 0);
   } else {
     sIsHighContrastOn = false;
   }
 
+  if (!IsAppThemed()) {
+    sThemeId = LookAndFeel::eWindowsTheme_Classic;
+    return;
+  }
+
   WCHAR themeFileName[MAX_PATH + 1];
   WCHAR themeColor[MAX_PATH + 1];
   if (FAILED(GetCurrentThemeName(themeFileName,
                                  MAX_PATH,
                                  themeColor,
                                  MAX_PATH,
                                  nullptr, 0))) {
     sThemeId = LookAndFeel::eWindowsTheme_Classic;