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 217354 f1c049a566e2f5848939dfc3b1a38d4a40be0649
parent 217353 747541380bbb12cc2de08ecd763cdffebc22465b
child 217355 59824d8a19aa46a5c47eb7b67bcd607e7bfbe614
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, lmandel
bugs1042625
milestone33.0a2
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;