MozillaFirefox/show-context-menu-on-mouse-release.patch
Wolfgang Rosenauer fe9ab0007d Accepting request 542056 from home:cgiboudeaux:branches:mozilla:Factory
- Add show-context-menu-on-mouse-release.patch.
  Starting with Firefox 57, the context menu appears on key press.
  This patch creates a config entry to restore the
  old behaviour. Without the patch, the mouse gesture extensions
  require 2 clicks to work (bmo#1360278). The config entry is named
  "input.contextMenu.onRelease" (default: false).

OBS-URL: https://build.opensuse.org/request/show/542056
OBS-URL: https://build.opensuse.org/package/show/mozilla:Factory/MozillaFirefox?expand=0&rev=613
2017-11-18 08:20:26 +00:00

62 lines
2.4 KiB
Diff

# HG changeset patch
# User Dimi Meim <dimimeim@gmail.com>
# Date 1508186130 -10800
# Mon Oct 16 23:35:30 2017 +0300
# Node ID 7251515cd508453edff10be2e1294261ef1dc4b5
# Parent c241c2b44a75f4bad80e12c3a1a7cb5aaf37a3f7
Bug-1360278-fix
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -5913,3 +5913,6 @@ pref("dom.noopener.newprocess.enabled",
pref("layers.omtp.enabled", false);
pref("layers.omtp.force-sync", false);
+
+//Pop up context menu on mouse button release
+pref("input.contextMenu.onRelease", false);
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
--- a/widget/gtk/nsWindow.cpp
+++ b/widget/gtk/nsWindow.cpp
@@ -362,6 +362,7 @@ static bool gBlockActivateE
static bool gGlobalsInitialized = false;
static bool gRaiseWindows = true;
+static bool menuContextOnClickRelease = false;
#if GTK_CHECK_VERSION(3,4,0)
static uint32_t gLastTouchID = 0;
#endif
@@ -2795,9 +2796,11 @@ nsWindow::OnButtonPressEvent(GdkEventBut
DispatchInputEvent(&event);
+ Preferences::AddBoolVarCache(&menuContextOnClickRelease, "input.contextMenu.onRelease", false);
+
// right menu click on linux should also pop up a context menu
if (domButton == WidgetMouseEvent::eRightButton &&
- MOZ_LIKELY(!mIsDestroyed)) {
+ MOZ_LIKELY(!mIsDestroyed) && !menuContextOnClickRelease) {
WidgetMouseEvent contextMenuEvent(true, eContextMenu, this,
WidgetMouseEvent::eReal);
InitButtonEvent(contextMenuEvent, aEvent);
@@ -2838,6 +2841,18 @@ nsWindow::OnButtonReleaseEvent(GdkEventB
DispatchInputEvent(&event);
mLastMotionPressure = pressure;
+
+ Preferences::AddBoolVarCache(&menuContextOnClickRelease, "input.contextMenu.onRelease", false);
+
+ // right menu click on linux should also pop up a context menu
+ if (domButton == WidgetMouseEvent::eRightButton &&
+ MOZ_LIKELY(!mIsDestroyed) && menuContextOnClickRelease) {
+ WidgetMouseEvent contextMenuEvent(true, eContextMenu, this,
+ WidgetMouseEvent::eReal);
+ InitButtonEvent(contextMenuEvent, aEvent);
+ contextMenuEvent.pressure = mLastMotionPressure;
+ DispatchInputEvent(&contextMenuEvent);
+ }
}
void