Bug 1360278 - Add preference to trigger context menu on mouse up for GTK+ and macOS, r=mstange,smaug

MozReview-Commit-ID: Bg60bD8jIg6
This commit is contained in:
Robin Grenet
2017-11-16 13:35:58 +01:00
parent ede93cc266
commit 001b80d26a
6 changed files with 69 additions and 9 deletions

View File

@@ -1218,6 +1218,22 @@ nsBaseWidget::DispatchEventToAPZOnly(mozilla::WidgetInputEvent* aEvent)
}
}
// static
bool
nsBaseWidget::ShowContextMenuAfterMouseUp()
{
static bool gContextMenuAfterMouseUp = false;
static bool gContextMenuAfterMouseUpCached = false;
if (!gContextMenuAfterMouseUpCached) {
Preferences::AddBoolVarCache(&gContextMenuAfterMouseUp,
"ui.context_menus.after_mouseup",
false);
gContextMenuAfterMouseUpCached = true;
}
return gContextMenuAfterMouseUp;
}
nsIDocument*
nsBaseWidget::GetDocument() const
{