Bug 611693 - Fix for Txul, Ts regression on XP after landing bug 610201. r=vlad, a=regression.
authorJim Mathies <jmathies@mozilla.com>
Sun, 14 Nov 2010 11:34:13 -0600
changeset 57470 05a80026d34752726c4ce7c3e27e0aac8c0fe716
parent 57469 7dc151ce96f242451f5e99c623f68b1f96a47d9c
child 57471 f8e81c8196d2ad41e498550c6ee1cad243951bd5
push id16938
push userjmathies@mozilla.com
push dateSun, 14 Nov 2010 17:34:24 +0000
treeherdermozilla-central@05a80026d347 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersvlad, regression
bugs611693, 610201
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 611693 - Fix for Txul, Ts regression on XP after landing bug 610201. r=vlad, a=regression.
widget/src/windows/nsNativeThemeWin.cpp
widget/src/windows/nsUXThemeData.cpp
--- a/widget/src/windows/nsNativeThemeWin.cpp
+++ b/widget/src/windows/nsNativeThemeWin.cpp
@@ -161,16 +161,18 @@ static PRInt32 GetClassicWindowFrameButt
       return DFCS_BUTTONPUSH|DFCS_PUSHED; 
     return DFCS_BUTTONPUSH|DFCS_HOT;
   }
   return DFCS_BUTTONPUSH;
 }
 
 static void QueryForButtonData(nsIFrame *aFrame)
 {
+  if (nsUXThemeData::sTitlebarInfoPopulatedThemed && nsUXThemeData::sTitlebarInfoPopulatedAero)
+    return;
   nsIWidget* widget = aFrame->GetNearestWidget();
   nsWindow * window = static_cast<nsWindow*>(widget);
   if (!window)
     return;
   if (!window->IsTopLevelWidget() &&
       !(window = window->GetParentWindow(PR_FALSE)))
     return;
 
--- a/widget/src/windows/nsUXThemeData.cpp
+++ b/widget/src/windows/nsUXThemeData.cpp
@@ -390,18 +390,18 @@ PRBool nsUXThemeData::IsDefaultWindowThe
 {
   return sIsDefaultWindowsTheme;
 }
 
 // static
 void
 nsUXThemeData::UpdateNativeThemeInfo()
 {
-  // Trigger a refresh of themed button metrics
-  sTitlebarInfoPopulatedThemed = PR_FALSE;
+  // Trigger a refresh of themed button metrics if needed
+  sTitlebarInfoPopulatedThemed = (nsWindow::GetWindowsVersion() < VISTA_VERSION);
 
   sIsDefaultWindowsTheme = PR_FALSE;
   sThemeId = nsILookAndFeel::eWindowsTheme_Generic;
 
   if (!IsAppThemed() || !getCurrentThemeName) {
     sThemeId = nsILookAndFeel::eWindowsTheme_Classic;
     return;
   }