зеркало из 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,
|
NS_IMPL_ISUPPORTS(nsXULPopupManager,
|
||||||
nsIDOMEventListener,
|
nsIDOMEventListener,
|
||||||
nsITimerCallback,
|
nsITimerCallback,
|
||||||
|
@ -127,6 +132,8 @@ nsXULPopupManager::nsXULPopupManager() :
|
||||||
if (obs) {
|
if (obs) {
|
||||||
obs->AddObserver(this, "xpcom-shutdown", false);
|
obs->AddObserver(this, "xpcom-shutdown", false);
|
||||||
}
|
}
|
||||||
|
Preferences::AddBoolVarCache(&sDevtoolsDisableAutoHide,
|
||||||
|
kPrefDevtoolsDisableAutoHide, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsXULPopupManager::~nsXULPopupManager()
|
nsXULPopupManager::~nsXULPopupManager()
|
||||||
|
@ -183,6 +190,15 @@ bool
|
||||||
nsXULPopupManager::Rollup(uint32_t aCount, bool aFlush,
|
nsXULPopupManager::Rollup(uint32_t aCount, bool aFlush,
|
||||||
const nsIntPoint* pos, nsIContent** aLastRolledUp)
|
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;
|
bool consume = false;
|
||||||
|
|
||||||
nsMenuChainItem* item = GetTopVisibleMenu();
|
nsMenuChainItem* item = GetTopVisibleMenu();
|
||||||
|
|
|
@ -778,6 +778,9 @@ protected:
|
||||||
// the popup that is currently being opened, stored only during the
|
// the popup that is currently being opened, stored only during the
|
||||||
// popupshowing event
|
// popupshowing event
|
||||||
nsCOMPtr<nsIContent> mOpeningPopup;
|
nsCOMPtr<nsIContent> mOpeningPopup;
|
||||||
|
|
||||||
|
// If true, all popups won't hide automatically on blur
|
||||||
|
static bool sDevtoolsDisableAutoHide;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -220,6 +220,9 @@ pref("ui.use_native_colors", true);
|
||||||
pref("ui.click_hold_context_menus", false);
|
pref("ui.click_hold_context_menus", false);
|
||||||
// Duration of timeout of incremental search in menus (ms). 0 means infinite.
|
// Duration of timeout of incremental search in menus (ms). 0 means infinite.
|
||||||
pref("ui.menu.incremental_search.timeout", 1000);
|
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
|
pref("browser.display.use_document_fonts", 1); // 0 = never, 1 = quick, 2 = always
|
||||||
// 0 = default: always, except in high contrast mode
|
// 0 = default: always, except in high contrast mode
|
||||||
// 1 = always
|
// 1 = always
|
||||||
|
|
Загрузка…
Ссылка в новой задаче