From eaa576fa1a160de32582311d20f5d338a1fd77e4 Mon Sep 17 00:00:00 2001 From: "gavin%gavinsharp.com" Date: Thu, 8 May 2008 15:17:23 +0000 Subject: [PATCH] Bug 427173: fix massive tooltips after switching OS themes by making sure we release the right theme handle, patch by Kai Liu , r+sr=roc, a=schrep --- widget/src/windows/nsNativeThemeWin.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/widget/src/windows/nsNativeThemeWin.cpp b/widget/src/windows/nsNativeThemeWin.cpp index 34c1de90917..8b0ded5d12b 100644 --- a/widget/src/windows/nsNativeThemeWin.cpp +++ b/widget/src/windows/nsNativeThemeWin.cpp @@ -494,7 +494,8 @@ nsNativeThemeWin::GetTheme(PRUint8 aWidgetType) return mTextFieldTheme; } case NS_THEME_TOOLTIP: { - if (!mTooltipTheme) + // BUG #161600: XP/2K3 should force a classic treatment of tooltips + if (!mTooltipTheme && mIsVistaOrLater) mTooltipTheme = openTheme(NULL, L"Tooltip"); return mTooltipTheme; } @@ -1229,14 +1230,6 @@ nsNativeThemeWin::DrawWidgetBackground(nsIRenderingContext* aContext, if (!theme) return ClassicDrawWidgetBackground(aContext, aFrame, aWidgetType, aRect, aClipRect); -#ifndef WINCE - if (aWidgetType == NS_THEME_TOOLTIP && !mIsVistaOrLater) { - // BUG #161600: When rendering a non-classic tooltip, check - // for Windows prior to Vista, and if so, force a classic rendering - return ClassicDrawWidgetBackground(aContext, aFrame, aWidgetType, aRect, aClipRect); - } -#endif - if (!drawThemeBG) return NS_ERROR_FAILURE; @@ -1893,7 +1886,7 @@ nsNativeThemeWin::CloseData() CLOSE_THEME(mProgressTheme); CLOSE_THEME(mButtonTheme); CLOSE_THEME(mTextFieldTheme); - CLOSE_THEME(mToolbarTheme); + CLOSE_THEME(mTooltipTheme); CLOSE_THEME(mStatusbarTheme); CLOSE_THEME(mTabTheme); CLOSE_THEME(mTreeViewTheme);