зеркало из 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
|
||||
nsComboboxControlFrame::ToolkitHasNativePopup()
|
||||
{
|
||||
#ifdef MOZ_MACBROWSER
|
||||
return PR_TRUE;
|
||||
#ifdef XP_MACOSX
|
||||
return nsContentUtils::GetBoolPref("ui.use_native_popup_windows");
|
||||
#else
|
||||
return PR_FALSE;
|
||||
#endif
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
#include "nsIBaseWindow.h"
|
||||
#include "nsIInterfaceRequestorUtils.h"
|
||||
#include "nsIXULWindow.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsIPrefBranch.h"
|
||||
|
||||
// defined in nsMenuBarX.mm
|
||||
extern NSMenu* sApplicationMenu; // Application menu shared by all menubars
|
||||
|
@ -186,10 +188,15 @@ nsresult nsCocoaWindow::StandardCreate(nsIWidget *aParent,
|
|||
mWindowType = eWindowType_toplevel;
|
||||
}
|
||||
|
||||
#ifdef MOZ_MACBROWSER
|
||||
if (mWindowType == eWindowType_popup)
|
||||
return NS_OK;
|
||||
#endif
|
||||
// Some applications like Camino use native popup windows
|
||||
// (native context menus, native tooltips)
|
||||
nsCOMPtr<nsIPrefBranch> prefs = do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
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
|
||||
unsigned int features = NSBorderlessWindowMask;
|
||||
|
|
Загрузка…
Ссылка в новой задаче