Bug 474825 - honor mozilla.widget.disable-native-theme preference on windows. r/sr=stuart

This commit is contained in:
Doug Turner 2009-01-28 15:39:13 -08:00
parent b4821a4987
commit 21bba21b2c
3 changed files with 46 additions and 11 deletions

View File

@ -42,9 +42,7 @@ VPATH = @srcdir@
include $(DEPTH)/config/autoconf.mk
DIRS = $(NULL)
DIRS += libpixman/src cairo/src
DIRS = libpixman/src cairo/src
include $(topsrcdir)/config/rules.mk

View File

@ -75,12 +75,42 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(ChildWindow)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsFilePicker)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsLookAndFeel)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsNativeThemeWin)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsToolkit)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerWin)
#ifndef WINCE
// from nsWindow.cpp
extern PRBool gDisableNativeTheme;
static NS_IMETHODIMP
nsNativeThemeWinConstructor(nsISupports *aOuter, REFNSIID aIID,
void **aResult)
{
nsresult rv;
nsNativeThemeWin * inst;
if (gDisableNativeTheme)
return NS_ERROR_NO_INTERFACE;
*aResult = NULL;
if (NULL != aOuter) {
rv = NS_ERROR_NO_AGGREGATION;
return rv;
}
NS_NEWXPCOM(inst, nsNativeThemeWin);
if (NULL == inst) {
rv = NS_ERROR_OUT_OF_MEMORY;
return rv;
}
NS_ADDREF(inst);
rv = inst->QueryInterface(aIID, aResult);
NS_RELEASE(inst);
return rv;
}
#ifndef WINCE
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)

View File

@ -348,6 +348,9 @@ RECT* nsWindow::sIMECompCharPos = nsnull;
PRBool nsWindow::gSwitchKeyboardLayout = PR_FALSE;
// imported in nsWidgetFactory.cpp
PRBool gDisableNativeTheme = PR_FALSE;
#ifndef WINCE
static KeyboardLayout gKbdLayout;
#endif
@ -1367,16 +1370,20 @@ nsWindow::StandardWindowCreate(nsIWidget *aParent,
nsCOMPtr<nsIPrefBranch> prefBranch;
prefs->GetBranch(0, getter_AddRefs(prefBranch));
if (prefBranch) {
PRBool trimOnMinimize;
PRBool temp;
if (NS_SUCCEEDED(prefBranch->GetBoolPref("config.trim_on_minimize",
&trimOnMinimize))
&& trimOnMinimize)
&temp))
&& temp)
gTrimOnMinimize = 1;
PRBool switchKeyboardLayout;
if (NS_SUCCEEDED(prefBranch->GetBoolPref("intl.keyboard.per_window_layout",
&switchKeyboardLayout)))
gSwitchKeyboardLayout = switchKeyboardLayout;
&temp)))
gSwitchKeyboardLayout = temp;
if (NS_SUCCEEDED(prefBranch->GetBoolPref("mozilla.widget.disable-native-theme",
&temp)))
gDisableNativeTheme = temp;
}
}
}