mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-02-16 23:57:11 +00:00
extra/firefox to 57.0-2
This commit is contained in:
parent
5d15912dc5
commit
234cf57ae9
2 changed files with 209 additions and 2 deletions
|
@ -0,0 +1,202 @@
|
|||
From 34508b32f65d5ad8143623b1258eb92d347514e2 Mon Sep 17 00:00:00 2001
|
||||
Message-Id: <34508b32f65d5ad8143623b1258eb92d347514e2.1511260210.git.jan.steffens@gmail.com>
|
||||
From: Robin Grenet <robin.grenet@wanadoo.fr>
|
||||
Date: Thu, 16 Nov 2017 13:35:58 +0100
|
||||
Subject: [PATCH] Bug 1360278 - Add preference to trigger context menu on mouse
|
||||
up for GTK+ and macOS, r=mstange,smaug
|
||||
|
||||
MozReview-Commit-ID: Bg60bD8jIg6
|
||||
|
||||
--HG--
|
||||
extra : rebase_source : cc8bd5796096f49ad4fdab81885a426afd6117e4
|
||||
---
|
||||
modules/libpref/init/all.js | 4 ++++
|
||||
widget/cocoa/nsChildView.mm | 23 +++++++++++++++++++++--
|
||||
widget/gtk/nsWindow.cpp | 27 ++++++++++++++++++++-------
|
||||
widget/gtk/nsWindow.h | 2 ++
|
||||
widget/nsBaseWidget.cpp | 16 ++++++++++++++++
|
||||
widget/nsBaseWidget.h | 6 ++++++
|
||||
6 files changed, 69 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
|
||||
index 315422a6e2255e5f..92bcf5f02564d46e 100644
|
||||
--- a/modules/libpref/init/all.js
|
||||
+++ b/modules/libpref/init/all.js
|
||||
@@ -234,6 +234,10 @@ pref("browser.sessionhistory.max_total_viewers", -1);
|
||||
|
||||
pref("ui.use_native_colors", true);
|
||||
pref("ui.click_hold_context_menus", false);
|
||||
+
|
||||
+// Pop up context menu on mouseup instead of mousedown, if that's the OS default.
|
||||
+// Note: ignored on Windows (context menus always use mouseup)
|
||||
+pref("ui.context_menus.after_mouseup", 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
|
||||
diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm
|
||||
index cac897327a190422..bf42b4f8c0950753 100644
|
||||
--- a/widget/cocoa/nsChildView.mm
|
||||
+++ b/widget/cocoa/nsChildView.mm
|
||||
@@ -4700,30 +4700,49 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
if (!mGeckoChild)
|
||||
return;
|
||||
|
||||
- // Let the superclass do the context menu stuff.
|
||||
- [super rightMouseDown:theEvent];
|
||||
+ if (!nsBaseWidget::ShowContextMenuAfterMouseUp()) {
|
||||
+ // Let the superclass do the context menu stuff.
|
||||
+ [super rightMouseDown:theEvent];
|
||||
+ }
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
|
||||
- (void)rightMouseUp:(NSEvent *)theEvent
|
||||
{
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
if (!mGeckoChild)
|
||||
return;
|
||||
if (mTextInputHandler->OnHandleEvent(theEvent)) {
|
||||
return;
|
||||
}
|
||||
|
||||
WidgetMouseEvent geckoEvent(true, eMouseUp, mGeckoChild,
|
||||
WidgetMouseEvent::eReal);
|
||||
[self convertCocoaMouseEvent:theEvent toGeckoEvent:&geckoEvent];
|
||||
geckoEvent.button = WidgetMouseEvent::eRightButton;
|
||||
geckoEvent.mClickCount = [theEvent clickCount];
|
||||
|
||||
nsAutoRetainCocoaObject kungFuDeathGrip(self);
|
||||
mGeckoChild->DispatchInputEvent(&geckoEvent);
|
||||
+ if (!mGeckoChild)
|
||||
+ return;
|
||||
+
|
||||
+ if (nsBaseWidget::ShowContextMenuAfterMouseUp()) {
|
||||
+ // Let the superclass do the context menu stuff, but pretend it's rightMouseDown.
|
||||
+ NSEvent *dupeEvent = [NSEvent mouseEventWithType:NSRightMouseDown
|
||||
+ location:theEvent.locationInWindow
|
||||
+ modifierFlags:theEvent.modifierFlags
|
||||
+ timestamp:theEvent.timestamp
|
||||
+ windowNumber:theEvent.windowNumber
|
||||
+ context:theEvent.context
|
||||
+ eventNumber:theEvent.eventNumber
|
||||
+ clickCount:theEvent.clickCount
|
||||
+ pressure:theEvent.pressure];
|
||||
+
|
||||
+ [super rightMouseDown:dupeEvent];
|
||||
+ }
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
|
||||
index 87cc858ca7efd11d..17992f78bbf0a0a7 100644
|
||||
--- a/widget/gtk/nsWindow.cpp
|
||||
+++ b/widget/gtk/nsWindow.cpp
|
||||
@@ -2737,6 +2737,19 @@ static guint ButtonMaskFromGDKButton(guint button)
|
||||
return GDK_BUTTON1_MASK << (button - 1);
|
||||
}
|
||||
|
||||
+void
|
||||
+nsWindow::DispatchContextMenuEventFromMouseEvent(uint16_t domButton,
|
||||
+ GdkEventButton *aEvent)
|
||||
+{
|
||||
+ if (domButton == WidgetMouseEvent::eRightButton && MOZ_LIKELY(!mIsDestroyed)) {
|
||||
+ WidgetMouseEvent contextMenuEvent(true, eContextMenu, this,
|
||||
+ WidgetMouseEvent::eReal);
|
||||
+ InitButtonEvent(contextMenuEvent, aEvent);
|
||||
+ contextMenuEvent.pressure = mLastMotionPressure;
|
||||
+ DispatchInputEvent(&contextMenuEvent);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void
|
||||
nsWindow::OnButtonPressEvent(GdkEventButton *aEvent)
|
||||
{
|
||||
@@ -2806,13 +2819,8 @@ nsWindow::OnButtonPressEvent(GdkEventButton *aEvent)
|
||||
DispatchInputEvent(&event);
|
||||
|
||||
// right menu click on linux should also pop up a context menu
|
||||
- if (domButton == WidgetMouseEvent::eRightButton &&
|
||||
- MOZ_LIKELY(!mIsDestroyed)) {
|
||||
- WidgetMouseEvent contextMenuEvent(true, eContextMenu, this,
|
||||
- WidgetMouseEvent::eReal);
|
||||
- InitButtonEvent(contextMenuEvent, aEvent);
|
||||
- contextMenuEvent.pressure = mLastMotionPressure;
|
||||
- DispatchInputEvent(&contextMenuEvent);
|
||||
+ if (!nsBaseWidget::ShowContextMenuAfterMouseUp()) {
|
||||
+ DispatchContextMenuEventFromMouseEvent(domButton, aEvent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2848,6 +2856,11 @@ nsWindow::OnButtonReleaseEvent(GdkEventButton *aEvent)
|
||||
|
||||
DispatchInputEvent(&event);
|
||||
mLastMotionPressure = pressure;
|
||||
+
|
||||
+ // right menu click on linux should also pop up a context menu
|
||||
+ if (nsBaseWidget::ShowContextMenuAfterMouseUp()) {
|
||||
+ DispatchContextMenuEventFromMouseEvent(domButton, aEvent);
|
||||
+ }
|
||||
}
|
||||
|
||||
void
|
||||
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
|
||||
index 0fafc8994579fe3c..7a28e3260c0fdefb 100644
|
||||
--- a/widget/gtk/nsWindow.h
|
||||
+++ b/widget/gtk/nsWindow.h
|
||||
@@ -245,6 +245,8 @@ private:
|
||||
|
||||
void UpdateClientOffset();
|
||||
|
||||
+ void DispatchContextMenuEventFromMouseEvent(uint16_t domButton,
|
||||
+ GdkEventButton *aEvent);
|
||||
public:
|
||||
void ThemeChanged(void);
|
||||
void OnDPIChanged(void);
|
||||
diff --git a/widget/nsBaseWidget.cpp b/widget/nsBaseWidget.cpp
|
||||
index 13fccd7f7d6627fb..e4ca5e011894f5c4 100644
|
||||
--- a/widget/nsBaseWidget.cpp
|
||||
+++ b/widget/nsBaseWidget.cpp
|
||||
@@ -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
|
||||
{
|
||||
diff --git a/widget/nsBaseWidget.h b/widget/nsBaseWidget.h
|
||||
index f4e8e3d783307cc1..3cb56f38b6ced983 100644
|
||||
--- a/widget/nsBaseWidget.h
|
||||
+++ b/widget/nsBaseWidget.h
|
||||
@@ -417,6 +417,12 @@ public:
|
||||
void RecvScreenPixels(mozilla::ipc::Shmem&& aMem, const ScreenIntSize& aSize) override {};
|
||||
#endif
|
||||
|
||||
+ /**
|
||||
+ * Whether context menus should only appear on mouseup instead of mousedown,
|
||||
+ * on OSes where they normally appear on mousedown (macOS, *nix).
|
||||
+ */
|
||||
+ static bool ShowContextMenuAfterMouseUp();
|
||||
+
|
||||
protected:
|
||||
// These are methods for CompositorWidgetWrapper, and should only be
|
||||
// accessed from that class. Derived widgets can choose which methods to
|
||||
--
|
||||
2.15.0
|
|
@ -12,9 +12,9 @@ highmem=1
|
|||
|
||||
pkgname=firefox
|
||||
pkgver=57.0
|
||||
pkgrel=1
|
||||
pkgrel=2
|
||||
pkgdesc="Standalone web browser from mozilla.org"
|
||||
arch=(i686 x86_64)
|
||||
arch=(x86_64)
|
||||
license=(MPL GPL LGPL)
|
||||
url="https://www.mozilla.org/firefox/"
|
||||
depends=(gtk3 gtk2 mozilla-common libxt startup-notification mime-types dbus-glib ffmpeg
|
||||
|
@ -28,11 +28,13 @@ optdepends=('networkmanager: Location detection via available WiFi networks'
|
|||
options=(!emptydirs !makeflags !strip)
|
||||
source=(https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz
|
||||
$pkgname.desktop firefox-symbolic.svg
|
||||
0001-Bug-1360278-Add-preference-to-trigger-context-menu-o.patch
|
||||
wifi-disentangle.patch wifi-fix-interface.patch
|
||||
firefox-install-dir.patch no-plt.diff)
|
||||
sha256sums=('603af00155be87f2c9c58047dd0072971f1cdab1f632695aae6ad072efefbb8f'
|
||||
'677e1bde4c6b3cff114345c211805c7c43085038ca0505718a11e96432e9811a'
|
||||
'a2474b32b9b2d7e0fb53a4c89715507ad1c194bef77713d798fa39d507def9e9'
|
||||
'1f71b379f2262d7319624c2aed31fa2dbed42828feccc27b1cd82153b76ad707'
|
||||
'f068b84ad31556095145d8fefc012dd3d1458948533ed3fff6cbc7250b6e73ed'
|
||||
'e98a3453d803cc7ddcb81a7dc83f883230dd8591bdf936fc5a868428979ed1f1'
|
||||
'd86e41d87363656ee62e12543e2f5181aadcff448e406ef3218e91865ae775cd'
|
||||
|
@ -58,6 +60,9 @@ prepare() {
|
|||
cd $pkgname-$pkgver
|
||||
patch -Np1 -i ../firefox-install-dir.patch
|
||||
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1360278
|
||||
patch -Np1 -i ../0001-Bug-1360278-Add-preference-to-trigger-context-menu-o.patch
|
||||
|
||||
# https://bugzilla.mozilla.org/show_bug.cgi?id=1314968
|
||||
patch -Np1 -i ../wifi-disentangle.patch
|
||||
patch -Np1 -i ../wifi-fix-interface.patch
|
||||
|
|
Loading…
Reference in a new issue