зеркало из https://github.com/mozilla/gecko-dev.git
remove app-specific code from tier-9 code. add a pref to handle native popup windows on Mac OS X instead. b=323062 r=smorgan sr=bsmedberg
This commit is contained in:
Родитель
0fcc24926a
Коммит
ed5252f114
|
@ -1471,8 +1471,8 @@ nsComboboxControlFrame::RestoreState(nsPresState* aState)
|
||||||
PRBool
|
PRBool
|
||||||
nsComboboxControlFrame::ToolkitHasNativePopup()
|
nsComboboxControlFrame::ToolkitHasNativePopup()
|
||||||
{
|
{
|
||||||
#ifdef MOZ_MACBROWSER
|
#ifdef XP_MACOSX
|
||||||
return PR_TRUE;
|
return nsContentUtils::GetBoolPref("ui.use_native_popup_windows");
|
||||||
#else
|
#else
|
||||||
return PR_FALSE;
|
return PR_FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -49,6 +49,8 @@
|
||||||
#include "nsIBaseWindow.h"
|
#include "nsIBaseWindow.h"
|
||||||
#include "nsIInterfaceRequestorUtils.h"
|
#include "nsIInterfaceRequestorUtils.h"
|
||||||
#include "nsIXULWindow.h"
|
#include "nsIXULWindow.h"
|
||||||
|
#include "nsIPrefService.h"
|
||||||
|
#include "nsIPrefBranch.h"
|
||||||
|
|
||||||
// defined in nsMenuBarX.mm
|
// defined in nsMenuBarX.mm
|
||||||
extern NSMenu* sApplicationMenu; // Application menu shared by all menubars
|
extern NSMenu* sApplicationMenu; // Application menu shared by all menubars
|
||||||
|
@ -185,12 +187,17 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
|
||||||
allOrDefault = PR_TRUE;
|
allOrDefault = PR_TRUE;
|
||||||
mWindowType = eWindowType_toplevel;
|
mWindowType = eWindowType_toplevel;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MOZ_MACBROWSER
|
// Some applications like Camino use native popup windows
|
||||||
if (mWindowType == eWindowType_popup)
|
// (native context menus, native tooltips)
|
||||||
return NS_OK;
|
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||||
#endif
|
if (prefs) {
|
||||||
|
PRBool useNativeContextMenus;
|
||||||
|
nsresult rv = prefs->GetBoolPref("ui.use_native_popup_windows", &useNativeContextMenus);
|
||||||
|
if (NS_SUCCEEDED(rv) && useNativeContextMenus && mWindowType == eWindowType_popup)
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
// we default to NSBorderlessWindowMask, add features if needed
|
// we default to NSBorderlessWindowMask, add features if needed
|
||||||
unsigned int features = NSBorderlessWindowMask;
|
unsigned int features = NSBorderlessWindowMask;
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче