Bug 605815. Only compute size for titlebar widget when DWM is on. r=jimm a=final
authorFelipe Gomes <felipc@gmail.com>
Fri, 22 Oct 2010 15:08:39 -0200
changeset 56364 2842d671052f602eefee9048c45b0337e25023f8
parent 56363 8ae7d48b0ad7e7c1fbbcc6af64085456c2016416
child 56366 9b7e1b761cb7e23e8ff46708cbd37031f149de51
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm, final
bugs605815
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 605815. Only compute size for titlebar widget when DWM is on. r=jimm a=final
widget/src/windows/nsNativeThemeWin.cpp
--- a/widget/src/windows/nsNativeThemeWin.cpp
+++ b/widget/src/windows/nsNativeThemeWin.cpp
@@ -1926,26 +1926,29 @@ nsNativeThemeWin::GetMinimumWidgetSize(n
     case NS_THEME_WINDOW_TITLEBAR_MAXIMIZED:
       aResult->height = GetSystemMetrics(SM_CYCAPTION);
       aResult->height += GetSystemMetrics(SM_CYFRAME);
       *aIsOverridable = PR_FALSE;
       return NS_OK;
 
     case NS_THEME_WINDOW_BUTTON_BOX:
     case NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED:
-      QueryForButtonData(aFrame);
-      aResult->width = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_BUTTONBOX].cx;
-      aResult->height = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_BUTTONBOX].cy
-                        - GetSystemMetrics(SM_CYFRAME);
-      if (aWidgetType == NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED) {
-        aResult->width += 1;
-        aResult->height -= 2;
+      if (nsUXThemeData::CheckForCompositor()) {
+        QueryForButtonData(aFrame);
+        aResult->width = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_BUTTONBOX].cx;
+        aResult->height = nsUXThemeData::sCommandButtons[CMDBUTTONIDX_BUTTONBOX].cy
+                          - GetSystemMetrics(SM_CYFRAME);
+        if (aWidgetType == NS_THEME_WINDOW_BUTTON_BOX_MAXIMIZED) {
+          aResult->width += 1;
+          aResult->height -= 2;
+        }
+        *aIsOverridable = PR_FALSE;
+        return NS_OK;
       }
-      *aIsOverridable = PR_FALSE;
-      return NS_OK;
+      break;
 
     case NS_THEME_WINDOW_FRAME_LEFT:
     case NS_THEME_WINDOW_FRAME_RIGHT:
     case NS_THEME_WINDOW_FRAME_BOTTOM:
       aResult->width = GetSystemMetrics(SM_CXFRAME);
       aResult->height = GetSystemMetrics(SM_CYFRAME);
       *aIsOverridable = PR_FALSE;
       return NS_OK;