зеркало из https://github.com/mozilla/gecko-dev.git
Bug 950936 - Introduce ui.popup.disable_autohide pref to ease debugging popups. r=neil
This commit is contained in:
Родитель
3d1a0313ed
Коммит
5d76a7e03f
|
@ -109,6 +109,11 @@ void nsMenuChainItem::Detach(nsMenuChainItem** aRoot)
|
|||
}
|
||||
}
|
||||
|
||||
bool nsXULPopupManager::sDevtoolsDisableAutoHide = false;
|
||||
|
||||
const char* kPrefDevtoolsDisableAutoHide =
|
||||
"ui.popup.disable_autohide";
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsXULPopupManager,
|
||||
nsIDOMEventListener,
|
||||
nsITimerCallback,
|
||||
|
@ -127,6 +132,8 @@ nsXULPopupManager::nsXULPopupManager() :
|
|||
if (obs) {
|
||||
obs->AddObserver(this, "xpcom-shutdown", false);
|
||||
}
|
||||
Preferences::AddBoolVarCache(&sDevtoolsDisableAutoHide,
|
||||
kPrefDevtoolsDisableAutoHide, false);
|
||||
}
|
||||
|
||||
nsXULPopupManager::~nsXULPopupManager()
|
||||
|
@ -183,6 +190,15 @@ bool
|
|||
nsXULPopupManager::Rollup(uint32_t aCount, bool aFlush,
|
||||
const nsIntPoint* pos, nsIContent** aLastRolledUp)
|
||||
{
|
||||
// We can disable the autohide behavior via a pref to ease debugging.
|
||||
if (nsXULPopupManager::sDevtoolsDisableAutoHide) {
|
||||
// Required on linux to allow events to work on other targets.
|
||||
if (mWidget) {
|
||||
mWidget->CaptureRollupEvents(nullptr, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool consume = false;
|
||||
|
||||
nsMenuChainItem* item = GetTopVisibleMenu();
|
||||
|
|
|
@ -778,6 +778,9 @@ protected:
|
|||
// the popup that is currently being opened, stored only during the
|
||||
// popupshowing event
|
||||
nsCOMPtr<nsIContent> mOpeningPopup;
|
||||
|
||||
// If true, all popups won't hide automatically on blur
|
||||
static bool sDevtoolsDisableAutoHide;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -220,6 +220,9 @@ pref("ui.use_native_colors", true);
|
|||
pref("ui.click_hold_context_menus", false);
|
||||
// Duration of timeout of incremental search in menus (ms). 0 means infinite.
|
||||
pref("ui.menu.incremental_search.timeout", 1000);
|
||||
// If true, all popups won't hide automatically on blur
|
||||
pref("ui.popup.disable_autohide", false);
|
||||
|
||||
pref("browser.display.use_document_fonts", 1); // 0 = never, 1 = quick, 2 = always
|
||||
// 0 = default: always, except in high contrast mode
|
||||
// 1 = always
|
||||
|
|
Загрузка…
Ссылка в новой задаче