firefox-96.0
This commit is contained in:
-203
@@ -1,203 +0,0 @@
|
|||||||
From 05ec1aa0d5e8806dd0c5c6d08c82846a1389b599 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <05ec1aa0d5e8806dd0c5c6d08c82846a1389b599.1512038840.git.jan.steffens@gmail.com>
|
|
||||||
From: Robin Grenet <robin.grenet@wanadoo.fr>
|
|
||||||
Date: Thu, 16 Nov 2017 13:35:58 +0100
|
|
||||||
Subject: [PATCH 1/2] 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 9febead1d363d792..7a6e6a20f3cc3fd6 100644
|
|
||||||
--- a/modules/libpref/init/all.js
|
|
||||||
+++ b/modules/libpref/init/all.js
|
|
||||||
@@ -231,6 +231,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 25b4c1ba7a2d1207..2affd1ef386cbfd0 100644
|
|
||||||
--- a/widget/cocoa/nsChildView.mm
|
|
||||||
+++ b/widget/cocoa/nsChildView.mm
|
|
||||||
@@ -4719,30 +4719,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 37b6aae4c3d0b4e7..2b80124538c20ed6 100644
|
|
||||||
--- a/widget/gtk/nsWindow.cpp
|
|
||||||
+++ b/widget/gtk/nsWindow.cpp
|
|
||||||
@@ -2727,6 +2727,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)
|
|
||||||
{
|
|
||||||
@@ -2796,13 +2809,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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -2838,6 +2846,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 f7c07d57491b0b83..b969c9db4306ba6a 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 996409f45db11cc7..de73fe36d27955cd 100644
|
|
||||||
--- a/widget/nsBaseWidget.cpp
|
|
||||||
+++ b/widget/nsBaseWidget.cpp
|
|
||||||
@@ -1222,6 +1222,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 6d6b93ea73d64b38..cdc6aa0c87279832 100644
|
|
||||||
--- a/widget/nsBaseWidget.h
|
|
||||||
+++ b/widget/nsBaseWidget.h
|
|
||||||
@@ -418,6 +418,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.1
|
|
||||||
|
|
||||||
-117
@@ -1,117 +0,0 @@
|
|||||||
From 2874ecd82e9671f774bdfda41fe0857fcb916c13 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <2874ecd82e9671f774bdfda41fe0857fcb916c13.1506634385.git.jan.steffens@gmail.com>
|
|
||||||
From: Mike Hommey <mh+mozilla@glandium.org>
|
|
||||||
Date: Wed, 16 Aug 2017 13:16:16 +0900
|
|
||||||
Subject: [PATCH] Bug 1384062 - Make SystemResourceMonitor.stop more resilient
|
|
||||||
to errors. r=ahal,gps
|
|
||||||
|
|
||||||
The poll() call in SystemResourceMonitor.stop might fail even though
|
|
||||||
there is something to read from the pipe, in some corner cases, and
|
|
||||||
python won't let us know about it. In that case, an exception is thrown,
|
|
||||||
leaving the SystemResourceMonitor (and its callers) in a weird state. In
|
|
||||||
practice, this leads BuildMonitor.__exit__ to recall stop, which then
|
|
||||||
fails.
|
|
||||||
|
|
||||||
So when poll() throws an exception, we pretend there's still something
|
|
||||||
to read, and we try to read anyways. If there is something to read,
|
|
||||||
recv() will return it, otherwise, it will throw an exception of its own,
|
|
||||||
which we catch, pretending we're done.
|
|
||||||
|
|
||||||
Furthermore, when there is nothing to read from the pipe, poll() simply
|
|
||||||
returns False, and our loop never sets `done` to True, and we then hit
|
|
||||||
an assert, which doesn't have its place here, so we remove it.
|
|
||||||
|
|
||||||
Finally, the other end of the pipe might have died at any time, making
|
|
||||||
sending over the pipe fail, so we also protect against that.
|
|
||||||
|
|
||||||
With all these changes, it feels like the reason to backout bug 1239939
|
|
||||||
in bug 1272782 should have been dealt with, and we can drop the timeout
|
|
||||||
again.
|
|
||||||
|
|
||||||
--HG--
|
|
||||||
extra : rebase_source : ac72dd5b2602cf3ffddfb429f95e02380f939893
|
|
||||||
---
|
|
||||||
.../mozsystemmonitor/resourcemonitor.py | 38 +++++++++++++++-------
|
|
||||||
1 file changed, 26 insertions(+), 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
|
|
||||||
index 8f2ac95cbe505540..38f9bc986ac2a120 100644
|
|
||||||
--- a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
|
|
||||||
+++ b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
|
|
||||||
@@ -289,47 +289,61 @@ class SystemResourceMonitor(object):
|
|
||||||
assert self._running
|
|
||||||
assert not self._stopped
|
|
||||||
|
|
||||||
- self._pipe.send(('terminate',))
|
|
||||||
+ try:
|
|
||||||
+ self._pipe.send(('terminate',))
|
|
||||||
+ except Exception:
|
|
||||||
+ pass
|
|
||||||
self._running = False
|
|
||||||
self._stopped = True
|
|
||||||
|
|
||||||
self.measurements = []
|
|
||||||
|
|
||||||
- done = False
|
|
||||||
-
|
|
||||||
# The child process will send each data sample over the pipe
|
|
||||||
# as a separate data structure. When it has finished sending
|
|
||||||
# samples, it sends a special "done" message to indicate it
|
|
||||||
# is finished.
|
|
||||||
- while self._pipe.poll(1.0):
|
|
||||||
- start_time, end_time, io_diff, cpu_diff, cpu_percent, virt_mem, \
|
|
||||||
- swap_mem = self._pipe.recv()
|
|
||||||
+
|
|
||||||
+ # multiprocessing.Pipe is not actually a pipe on at least Linux. that
|
|
||||||
+ # has an effect on the expected outcome of reading from it when the
|
|
||||||
+ # other end of the pipe dies, leading to possibly hanging on revc()
|
|
||||||
+ # below. So we must poll().
|
|
||||||
+ def poll():
|
|
||||||
+ try:
|
|
||||||
+ return self._pipe.poll(0.1)
|
|
||||||
+ except Exception:
|
|
||||||
+ # Poll might throw an exception even though there's still
|
|
||||||
+ # data to read. That happens when the underlying system call
|
|
||||||
+ # returns both POLLERR and POLLIN, but python doesn't tell us
|
|
||||||
+ # about it. So assume there is something to read, and we'll
|
|
||||||
+ # get an exception when trying to read the data.
|
|
||||||
+ return True
|
|
||||||
+ while poll():
|
|
||||||
+ try:
|
|
||||||
+ start_time, end_time, io_diff, cpu_diff, cpu_percent, virt_mem, \
|
|
||||||
+ swap_mem = self._pipe.recv()
|
|
||||||
+ except Exception:
|
|
||||||
+ # Let's assume we're done here
|
|
||||||
+ break
|
|
||||||
|
|
||||||
# There should be nothing after the "done" message so
|
|
||||||
# terminate.
|
|
||||||
if start_time == 'done':
|
|
||||||
- done = True
|
|
||||||
break
|
|
||||||
|
|
||||||
io = self._io_type(*io_diff)
|
|
||||||
virt = self._virt_type(*virt_mem)
|
|
||||||
swap = self._swap_type(*swap_mem)
|
|
||||||
cpu_times = [self._cpu_times_type(*v) for v in cpu_diff]
|
|
||||||
|
|
||||||
self.measurements.append(SystemResourceUsage(start_time, end_time,
|
|
||||||
cpu_times, cpu_percent, io, virt, swap))
|
|
||||||
|
|
||||||
# We establish a timeout so we don't hang forever if the child
|
|
||||||
# process has crashed.
|
|
||||||
self._process.join(10)
|
|
||||||
if self._process.is_alive():
|
|
||||||
self._process.terminate()
|
|
||||||
self._process.join(10)
|
|
||||||
- else:
|
|
||||||
- # We should have received a "done" message from the
|
|
||||||
- # child indicating it shut down properly. This only
|
|
||||||
- # happens if the child shuts down cleanly.
|
|
||||||
- assert done
|
|
||||||
|
|
||||||
if len(self.measurements):
|
|
||||||
self.start_time = self.measurements[0].start
|
|
||||||
--
|
|
||||||
2.14.2
|
|
||||||
|
|
||||||
-70
@@ -1,70 +0,0 @@
|
|||||||
From c3acffdb8e0cd46561d2c5131227dc92967cf3d2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kevin Jacobs <kjacobs@mozilla.com>
|
|
||||||
Date: Tue, 14 Apr 2020 18:32:19 +0000
|
|
||||||
Subject: [PATCH] Bug 1624128 - Update CK_GCM_PARAMS uses for PKCS11 v3.0
|
|
||||||
definition r=keeler
|
|
||||||
|
|
||||||
This patch initializes the ulIvBits member of CK_GCM_PARAMS, which is new in PKCS11 v3.
|
|
||||||
|
|
||||||
For libprio, we instead define NSS_PKCS11_2_0_COMPAT, which yields the old struct definition.
|
|
||||||
|
|
||||||
Differential Revision: https://phabricator.services.mozilla.com/D67740
|
|
||||||
---
|
|
||||||
dom/crypto/WebCryptoTask.cpp | 1 +
|
|
||||||
netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c | 1 +
|
|
||||||
security/manager/ssl/OSKeyStore.cpp | 1 +
|
|
||||||
third_party/prio/moz.build | 5 +++++
|
|
||||||
4 files changed, 8 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/dom/crypto/WebCryptoTask.cpp b/dom/crypto/WebCryptoTask.cpp
|
|
||||||
index ad0d1432738f..60a265972d21 100644
|
|
||||||
--- a/dom/crypto/WebCryptoTask.cpp
|
|
||||||
+++ b/dom/crypto/WebCryptoTask.cpp
|
|
||||||
@@ -600,6 +600,7 @@ class AesTask : public ReturnArrayBufferViewTask, public DeferredData {
|
|
||||||
case CKM_AES_GCM:
|
|
||||||
gcmParams.pIv = mIv.Elements();
|
|
||||||
gcmParams.ulIvLen = mIv.Length();
|
|
||||||
+ gcmParams.ulIvBits = gcmParams.ulIvLen * 8;
|
|
||||||
gcmParams.pAAD = mAad.Elements();
|
|
||||||
gcmParams.ulAADLen = mAad.Length();
|
|
||||||
gcmParams.ulTagBits = mTagLength;
|
|
||||||
diff --git a/netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c b/netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c
|
|
||||||
index e1fdbe36fbf8..2be2ce932ddf 100644
|
|
||||||
--- a/netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c
|
|
||||||
+++ b/netwerk/srtp/src/crypto/cipher/aes_gcm_nss.c
|
|
||||||
@@ -271,6 +271,7 @@ static srtp_err_status_t srtp_aes_gcm_nss_do_crypto(void *cv,
|
|
||||||
|
|
||||||
c->params.pIv = c->iv;
|
|
||||||
c->params.ulIvLen = GCM_IV_LEN;
|
|
||||||
+ c->params.ulIvBits = GCM_IV_LEN * 8;
|
|
||||||
c->params.pAAD = c->aad;
|
|
||||||
c->params.ulAADLen = c->aad_size;
|
|
||||||
|
|
||||||
diff --git a/security/manager/ssl/OSKeyStore.cpp b/security/manager/ssl/OSKeyStore.cpp
|
|
||||||
index 00bc918c5fdd..c83a559d9c1e 100644
|
|
||||||
--- a/security/manager/ssl/OSKeyStore.cpp
|
|
||||||
+++ b/security/manager/ssl/OSKeyStore.cpp
|
|
||||||
@@ -663,6 +663,7 @@ nsresult AbstractOSKeyStore::DoCipher(const UniquePK11SymKey& aSymKey,
|
|
||||||
CK_GCM_PARAMS gcm_params;
|
|
||||||
gcm_params.pIv = const_cast<unsigned char*>(ivp);
|
|
||||||
gcm_params.ulIvLen = mIVLength;
|
|
||||||
+ gcm_params.ulIvBits = gcm_params.ulIvLen * 8;
|
|
||||||
gcm_params.ulTagBits = 128;
|
|
||||||
gcm_params.pAAD = nullptr;
|
|
||||||
gcm_params.ulAADLen = 0;
|
|
||||||
diff --git a/third_party/prio/moz.build b/third_party/prio/moz.build
|
|
||||||
index 3e10fe71ce8e..0a6e3c74a269 100644
|
|
||||||
--- a/third_party/prio/moz.build
|
|
||||||
+++ b/third_party/prio/moz.build
|
|
||||||
@@ -42,3 +42,8 @@ SOURCES += [
|
|
||||||
]
|
|
||||||
|
|
||||||
FINAL_LIBRARY = 'xul'
|
|
||||||
+
|
|
||||||
+# Use PKCS11 v2 struct definitions for now, otherwise NSS requires
|
|
||||||
+# CK_GCM_PARAMS.ulIvBits to be set. This workaround is only required
|
|
||||||
+# until NSS 3.52 RTM and upstream correctly initializes the field.
|
|
||||||
+DEFINES['NSS_PKCS11_2_0_COMPAT'] = True
|
|
||||||
--
|
|
||||||
2.26.2
|
|
||||||
|
|
||||||
File diff suppressed because one or more lines are too long
-254
@@ -1,254 +0,0 @@
|
|||||||
From f19a0f3bc5e1e87d3c663cc2b147c5c0831519c5 Mon Sep 17 00:00:00 2001
|
|
||||||
Message-Id: <f19a0f3bc5e1e87d3c663cc2b147c5c0831519c5.1512038840.git.jan.steffens@gmail.com>
|
|
||||||
In-Reply-To: <05ec1aa0d5e8806dd0c5c6d08c82846a1389b599.1512038840.git.jan.steffens@gmail.com>
|
|
||||||
References: <05ec1aa0d5e8806dd0c5c6d08c82846a1389b599.1512038840.git.jan.steffens@gmail.com>
|
|
||||||
From: Bob Silverberg <bsilverberg@mozilla.com>
|
|
||||||
Date: Fri, 24 Nov 2017 07:45:03 -0500
|
|
||||||
Subject: [PATCH 2/2] Bug 1419426 - Implement
|
|
||||||
browserSettings.contextMenuShowEvent, r=kmag a=gchang
|
|
||||||
|
|
||||||
Uplift for 58.
|
|
||||||
---
|
|
||||||
.../components/extensions/ext-browserSettings.js | 45 ++++++++++++++++
|
|
||||||
.../extensions/schemas/browser_settings.json | 10 ++++
|
|
||||||
.../test/xpcshell/test_ext_browserSettings.js | 62 ++++++++++++++++++++--
|
|
||||||
3 files changed, 114 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/toolkit/components/extensions/ext-browserSettings.js b/toolkit/components/extensions/ext-browserSettings.js
|
|
||||||
index f3212f351baf6975..2b24bcc1d09091f2 100644
|
|
||||||
--- a/toolkit/components/extensions/ext-browserSettings.js
|
|
||||||
+++ b/toolkit/components/extensions/ext-browserSettings.js
|
|
||||||
@@ -2,17 +2,23 @@
|
|
||||||
/* vim: set sts=2 sw=2 et tw=80: */
|
|
||||||
"use strict";
|
|
||||||
|
|
||||||
+XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
|
|
||||||
+ "resource://gre/modules/AppConstants.jsm");
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionSettingsStore",
|
|
||||||
"resource://gre/modules/ExtensionSettingsStore.jsm");
|
|
||||||
XPCOMUtils.defineLazyModuleGetter(this, "Services",
|
|
||||||
"resource://gre/modules/Services.jsm");
|
|
||||||
|
|
||||||
XPCOMUtils.defineLazyServiceGetter(this, "aboutNewTabService",
|
|
||||||
"@mozilla.org/browser/aboutnewtab-service;1",
|
|
||||||
"nsIAboutNewTabService");
|
|
||||||
|
|
||||||
Cu.import("resource://gre/modules/ExtensionPreferencesManager.jsm");
|
|
||||||
|
|
||||||
+var {
|
|
||||||
+ ExtensionError,
|
|
||||||
+} = ExtensionUtils;
|
|
||||||
+
|
|
||||||
const HOMEPAGE_OVERRIDE_SETTING = "homepage_override";
|
|
||||||
const HOMEPAGE_URL_PREF = "browser.startup.homepage";
|
|
||||||
const URL_STORE_TYPE = "url_overrides";
|
|
||||||
@@ -82,6 +88,16 @@ ExtensionPreferencesManager.addSetting("imageAnimationBehavior", {
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
+ExtensionPreferencesManager.addSetting("contextMenuShowEvent", {
|
|
||||||
+ prefNames: [
|
|
||||||
+ "ui.context_menus.after_mouseup",
|
|
||||||
+ ],
|
|
||||||
+
|
|
||||||
+ setCallback(value) {
|
|
||||||
+ return {[this.prefNames[0]]: value === "mouseup"};
|
|
||||||
+ },
|
|
||||||
+});
|
|
||||||
+
|
|
||||||
this.browserSettings = class extends ExtensionAPI {
|
|
||||||
getAPI(context) {
|
|
||||||
let {extension} = context;
|
|
||||||
@@ -114,6 +130,35 @@ this.browserSettings = class extends ExtensionAPI {
|
|
||||||
() => {
|
|
||||||
return aboutNewTabService.newTabURL;
|
|
||||||
}, URL_STORE_TYPE, true),
|
|
||||||
+ contextMenuShowEvent: Object.assign(
|
|
||||||
+ getSettingsAPI(
|
|
||||||
+ extension,
|
|
||||||
+ "contextMenuShowEvent",
|
|
||||||
+ () => {
|
|
||||||
+ if (AppConstants.platform === "win") {
|
|
||||||
+ return "mouseup";
|
|
||||||
+ }
|
|
||||||
+ let prefValue = Services.prefs.getBoolPref(
|
|
||||||
+ "ui.context_menus.after_mouseup", null);
|
|
||||||
+ return prefValue ? "mouseup" : "mousedown";
|
|
||||||
+ }
|
|
||||||
+ ),
|
|
||||||
+ {
|
|
||||||
+ set: details => {
|
|
||||||
+ if (!["mouseup", "mousedown"].includes(details.value)) {
|
|
||||||
+ throw new ExtensionError(
|
|
||||||
+ `${details.value} is not a valid value for contextMenuShowEvent.`);
|
|
||||||
+ }
|
|
||||||
+ if (AppConstants.platform === "android" ||
|
|
||||||
+ (AppConstants.platform === "win" &&
|
|
||||||
+ details.value === "mousedown")) {
|
|
||||||
+ return false;
|
|
||||||
+ }
|
|
||||||
+ return ExtensionPreferencesManager.setSetting(
|
|
||||||
+ extension, "contextMenuShowEvent", details.value);
|
|
||||||
+ },
|
|
||||||
+ }
|
|
||||||
+ ),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}
|
|
||||||
diff --git a/toolkit/components/extensions/schemas/browser_settings.json b/toolkit/components/extensions/schemas/browser_settings.json
|
|
||||||
index af073d933723cbd5..4f354e69dfedaf96 100644
|
|
||||||
--- a/toolkit/components/extensions/schemas/browser_settings.json
|
|
||||||
+++ b/toolkit/components/extensions/schemas/browser_settings.json
|
|
||||||
@@ -27,28 +27,38 @@
|
|
||||||
"type": "string",
|
|
||||||
"enum": ["normal", "none", "once"],
|
|
||||||
"description": "How images should be animated in the browser."
|
|
||||||
+ },
|
|
||||||
+ {
|
|
||||||
+ "id": "ContextMenuMouseEvent",
|
|
||||||
+ "type": "string",
|
|
||||||
+ "enum": ["mouseup", "mousedown"],
|
|
||||||
+ "description": "After which mouse event context menus should popup."
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"allowPopupsForUserEvents": {
|
|
||||||
"$ref": "types.Setting",
|
|
||||||
"description": "Allows or disallows pop-up windows from opening in response to user events."
|
|
||||||
},
|
|
||||||
"cacheEnabled": {
|
|
||||||
"$ref": "types.Setting",
|
|
||||||
"description": "Enables or disables the browser cache."
|
|
||||||
},
|
|
||||||
"homepageOverride": {
|
|
||||||
"$ref": "types.Setting",
|
|
||||||
"description": "Returns the value of the overridden home page. Read-only."
|
|
||||||
},
|
|
||||||
"imageAnimationBehavior": {
|
|
||||||
"$ref": "types.Setting",
|
|
||||||
"description": "Controls the behaviour of image animation in the browser. This setting's value is of type ImageAnimationBehavior, defaulting to <code>normal</code>."
|
|
||||||
},
|
|
||||||
"newTabPageOverride": {
|
|
||||||
"$ref": "types.Setting",
|
|
||||||
"description": "Returns the value of the overridden new tab page. Read-only."
|
|
||||||
+ },
|
|
||||||
+ "contextMenuShowEvent": {
|
|
||||||
+ "$ref": "types.Setting",
|
|
||||||
+ "description": "Controls after which mouse event context menus popup. This setting's value is of type ContextMenuMouseEvent, which has possible values of <code>mouseup</code> and <code>mousedown</code>."
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
diff --git a/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js b/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
|
|
||||||
index 5c441df3e4198671..7e9c1576a723dfc6 100644
|
|
||||||
--- a/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
|
|
||||||
+++ b/toolkit/components/extensions/test/xpcshell/test_ext_browserSettings.js
|
|
||||||
@@ -24,13 +24,20 @@ add_task(async function test_browser_settings() {
|
|
||||||
"browser.cache.memory.enable": true,
|
|
||||||
"dom.popup_allowed_events": Preferences.get("dom.popup_allowed_events"),
|
|
||||||
"image.animation_mode": "none",
|
|
||||||
+ "ui.context_menus.after_mouseup": false,
|
|
||||||
};
|
|
||||||
|
|
||||||
async function background() {
|
|
||||||
browser.test.onMessage.addListener(async (msg, apiName, value) => {
|
|
||||||
let apiObj = browser.browserSettings[apiName];
|
|
||||||
- await apiObj.set({value});
|
|
||||||
- browser.test.sendMessage("settingData", await apiObj.get({}));
|
|
||||||
+ let result = await apiObj.set({value});
|
|
||||||
+ if (msg === "set") {
|
|
||||||
+ browser.test.assertTrue(result, "set returns true.");
|
|
||||||
+ browser.test.sendMessage("settingData", await apiObj.get({}));
|
|
||||||
+ } else {
|
|
||||||
+ browser.test.assertFalse(result, "set returns false for a no-op.");
|
|
||||||
+ browser.test.sendMessage("no-op set");
|
|
||||||
+ }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -69,33 +76,82 @@ add_task(async function test_browser_settings() {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+ async function testNoOpSetting(setting, value, expected) {
|
|
||||||
+ extension.sendMessage("setNoOp", setting, value);
|
|
||||||
+ await extension.awaitMessage("no-op set");
|
|
||||||
+ for (let pref in expected) {
|
|
||||||
+ equal(Preferences.get(pref), expected[pref], `${pref} set correctly for ${value}`);
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
await testSetting(
|
|
||||||
"cacheEnabled", false,
|
|
||||||
{
|
|
||||||
"browser.cache.disk.enable": false,
|
|
||||||
"browser.cache.memory.enable": false,
|
|
||||||
});
|
|
||||||
await testSetting(
|
|
||||||
"cacheEnabled", true,
|
|
||||||
{
|
|
||||||
"browser.cache.disk.enable": true,
|
|
||||||
"browser.cache.memory.enable": true,
|
|
||||||
});
|
|
||||||
|
|
||||||
await testSetting(
|
|
||||||
"allowPopupsForUserEvents", false,
|
|
||||||
{"dom.popup_allowed_events": ""});
|
|
||||||
await testSetting(
|
|
||||||
"allowPopupsForUserEvents", true,
|
|
||||||
{"dom.popup_allowed_events": PREFS["dom.popup_allowed_events"]});
|
|
||||||
|
|
||||||
for (let value of ["normal", "none", "once"]) {
|
|
||||||
await testSetting(
|
|
||||||
"imageAnimationBehavior", value,
|
|
||||||
{"image.animation_mode": value});
|
|
||||||
}
|
|
||||||
|
|
||||||
- await extension.unload();
|
|
||||||
+ // This setting is a no-op on Android.
|
|
||||||
+ if (AppConstants.platform === "android") {
|
|
||||||
+ await testNoOpSetting("contextMenuShowEvent", "mouseup",
|
|
||||||
+ {"ui.context_menus.after_mouseup": false});
|
|
||||||
+ } else {
|
|
||||||
+ await testSetting(
|
|
||||||
+ "contextMenuShowEvent", "mouseup",
|
|
||||||
+ {"ui.context_menus.after_mouseup": true});
|
|
||||||
+ }
|
|
||||||
|
|
||||||
+ // "mousedown" is also a no-op on Windows.
|
|
||||||
+ if (["android", "win"].includes(AppConstants.platform)) {
|
|
||||||
+ await testNoOpSetting("contextMenuShowEvent", "mousedown",
|
|
||||||
+ {"ui.context_menus.after_mouseup": AppConstants.platform === "win"});
|
|
||||||
+ } else {
|
|
||||||
+ await testSetting(
|
|
||||||
+ "contextMenuShowEvent", "mousedown",
|
|
||||||
+ {"ui.context_menus.after_mouseup": false});
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ await extension.unload();
|
|
||||||
await promiseShutdownManager();
|
|
||||||
});
|
|
||||||
+
|
|
||||||
+add_task(async function test_bad_value() {
|
|
||||||
+ async function background() {
|
|
||||||
+ await browser.test.assertRejects(
|
|
||||||
+ browser.browserSettings.contextMenuShowEvent.set({value: "bad"}),
|
|
||||||
+ /bad is not a valid value for contextMenuShowEvent/,
|
|
||||||
+ "contextMenuShowEvent.set rejects with an invalid value.");
|
|
||||||
+
|
|
||||||
+ browser.test.sendMessage("done");
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ let extension = ExtensionTestUtils.loadExtension({
|
|
||||||
+ background,
|
|
||||||
+ manifest: {
|
|
||||||
+ permissions: ["browserSettings"],
|
|
||||||
+ },
|
|
||||||
+ });
|
|
||||||
+
|
|
||||||
+ await extension.startup();
|
|
||||||
+ await extension.awaitMessage("done");
|
|
||||||
+ await extension.unload();
|
|
||||||
+});
|
|
||||||
--
|
|
||||||
2.15.1
|
|
||||||
|
|
||||||
-3514
File diff suppressed because one or more lines are too long
-28
@@ -1,28 +0,0 @@
|
|||||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Kevin Daudt <kdaudt@alpinelinux.org>
|
|
||||||
Date: Sun, 12 Dec 2021 13:38:48 +0000
|
|
||||||
Subject: [PATCH] Bug 1745560 - Add missing stub for wl_proxy_marshal_flags,
|
|
||||||
r=stransky
|
|
||||||
|
|
||||||
Firefox fails to build against wayland 1.20 because this symbol is missing
|
|
||||||
|
|
||||||
Differential Revision: https://phabricator.services.mozilla.com/D133583
|
|
||||||
---
|
|
||||||
widget/gtk/mozwayland/mozwayland.c | 7 +++++++
|
|
||||||
1 file changed, 7 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/widget/gtk/mozwayland/mozwayland.c b/widget/gtk/mozwayland/mozwayland.c
|
|
||||||
index 7a448e6321e2..1a86468b4f3d 100644
|
|
||||||
--- a/widget/gtk/mozwayland/mozwayland.c
|
|
||||||
+++ b/widget/gtk/mozwayland/mozwayland.c
|
|
||||||
@@ -200,3 +200,10 @@ MOZ_EXPORT int wl_list_empty(const struct wl_list* list) { return -1; }
|
|
||||||
|
|
||||||
MOZ_EXPORT void wl_list_insert_list(struct wl_list* list,
|
|
||||||
struct wl_list* other) {}
|
|
||||||
+
|
|
||||||
+MOZ_EXPORT struct wl_proxy* wl_proxy_marshal_flags(
|
|
||||||
+ struct wl_proxy* proxy, uint32_t opcode,
|
|
||||||
+ const struct wl_interface* interface, uint32_t version, uint32_t flags,
|
|
||||||
+ ...) {
|
|
||||||
+ return NULL;
|
|
||||||
+}
|
|
||||||
@@ -1,614 +0,0 @@
|
|||||||
This is a composition of these patches for Firefox 60:
|
|
||||||
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1441873
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1441665
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1456898
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1457309
|
|
||||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1457691
|
|
||||||
|
|
||||||
which fix popup window placement at CSD window mode.
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/widget/gtk/nsLookAndFeel.cpp b/widget/gtk/nsLookAndFeel.cpp
|
|
||||||
--- a/widget/gtk/nsLookAndFeel.cpp
|
|
||||||
+++ b/widget/gtk/nsLookAndFeel.cpp
|
|
||||||
@@ -1076,19 +1076,18 @@ nsLookAndFeel::EnsureInit()
|
|
||||||
nullptr);
|
|
||||||
|
|
||||||
GetSystemFontInfo(gtk_widget_get_style_context(entry),
|
|
||||||
&mFieldFontName, &mFieldFontStyle);
|
|
||||||
|
|
||||||
gtk_widget_destroy(window);
|
|
||||||
g_object_unref(labelWidget);
|
|
||||||
|
|
||||||
- // Require GTK 3.10 for GtkHeaderBar support and compatible window manager.
|
|
||||||
- mCSDAvailable = (gtk_check_version(3, 10, 0) == nullptr &&
|
|
||||||
- nsWindow::GetCSDSupportLevel() != nsWindow::CSD_SUPPORT_NONE);
|
|
||||||
+ mCSDAvailable =
|
|
||||||
+ nsWindow::GetSystemCSDSupportLevel() != nsWindow::CSD_SUPPORT_NONE;
|
|
||||||
|
|
||||||
mCSDCloseButton = false;
|
|
||||||
mCSDMinimizeButton = false;
|
|
||||||
mCSDMaximizeButton = false;
|
|
||||||
|
|
||||||
// We need to initialize whole CSD config explicitly because it's queried
|
|
||||||
// as -moz-gtk* media features.
|
|
||||||
WidgetNodeType buttonLayout[TOOLBAR_BUTTONS];
|
|
||||||
diff --git a/widget/gtk/nsWindow.h b/widget/gtk/nsWindow.h
|
|
||||||
--- a/widget/gtk/nsWindow.h
|
|
||||||
+++ b/widget/gtk/nsWindow.h
|
|
||||||
@@ -395,28 +395,26 @@ public:
|
|
||||||
// From GDK
|
|
||||||
int GdkCoordToDevicePixels(gint coord);
|
|
||||||
LayoutDeviceIntPoint GdkPointToDevicePixels(GdkPoint point);
|
|
||||||
LayoutDeviceIntPoint GdkEventCoordsToDevicePixels(gdouble x, gdouble y);
|
|
||||||
LayoutDeviceIntRect GdkRectToDevicePixels(GdkRectangle rect);
|
|
||||||
|
|
||||||
virtual bool WidgetTypeSupportsAcceleration() override;
|
|
||||||
|
|
||||||
- bool DoDrawTitlebar() const;
|
|
||||||
-
|
|
||||||
typedef enum { CSD_SUPPORT_SYSTEM, // CSD including shadows
|
|
||||||
CSD_SUPPORT_CLIENT, // CSD without shadows
|
|
||||||
CSD_SUPPORT_NONE, // WM does not support CSD at all
|
|
||||||
CSD_SUPPORT_UNKNOWN
|
|
||||||
} CSDSupportLevel;
|
|
||||||
/**
|
|
||||||
* Get the support of Client Side Decoration by checking
|
|
||||||
* the XDG_CURRENT_DESKTOP environment variable.
|
|
||||||
*/
|
|
||||||
- static CSDSupportLevel GetCSDSupportLevel();
|
|
||||||
+ static CSDSupportLevel GetSystemCSDSupportLevel();
|
|
||||||
|
|
||||||
protected:
|
|
||||||
virtual ~nsWindow();
|
|
||||||
|
|
||||||
// event handling code
|
|
||||||
void DispatchActivateEvent(void);
|
|
||||||
void DispatchDeactivateEvent(void);
|
|
||||||
void DispatchResized();
|
|
||||||
@@ -512,19 +510,21 @@ private:
|
|
||||||
int mXDepth;
|
|
||||||
mozilla::widget::WindowSurfaceProvider mSurfaceProvider;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Upper bound on pending ConfigureNotify events to be dispatched to the
|
|
||||||
// window. See bug 1225044.
|
|
||||||
unsigned int mPendingConfigures;
|
|
||||||
|
|
||||||
- bool mIsCSDAvailable;
|
|
||||||
+ // Window titlebar rendering mode, CSD_SUPPORT_NONE if it's disabled
|
|
||||||
+ // for this window.
|
|
||||||
+ CSDSupportLevel mCSDSupportLevel;
|
|
||||||
// If true, draw our own window titlebar.
|
|
||||||
- bool mIsCSDEnabled;
|
|
||||||
+ bool mDrawInTitlebar;
|
|
||||||
// Draggable titlebar region maintained by UpdateWindowDraggingRegion
|
|
||||||
LayoutDeviceIntRegion mDraggableRegion;
|
|
||||||
|
|
||||||
#ifdef ACCESSIBILITY
|
|
||||||
RefPtr<mozilla::a11y::Accessible> mRootAccessible;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Request to create the accessible for this window if it is top level.
|
|
||||||
|
|
||||||
diff --git a/widget/gtk/nsWindow.cpp b/widget/gtk/nsWindow.cpp
|
|
||||||
--- a/widget/gtk/nsWindow.cpp
|
|
||||||
+++ b/widget/gtk/nsWindow.cpp
|
|
||||||
@@ -474,18 +474,18 @@ nsWindow::nsWindow()
|
|
||||||
|
|
||||||
mTransparencyBitmapWidth = 0;
|
|
||||||
mTransparencyBitmapHeight = 0;
|
|
||||||
|
|
||||||
#if GTK_CHECK_VERSION(3,4,0)
|
|
||||||
mLastScrollEventTime = GDK_CURRENT_TIME;
|
|
||||||
#endif
|
|
||||||
mPendingConfigures = 0;
|
|
||||||
- mIsCSDAvailable = false;
|
|
||||||
- mIsCSDEnabled = false;
|
|
||||||
+ mCSDSupportLevel = CSD_SUPPORT_NONE;
|
|
||||||
+ mDrawInTitlebar = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
nsWindow::~nsWindow()
|
|
||||||
{
|
|
||||||
LOG(("nsWindow::~nsWindow() [%p]\n", (void *)this));
|
|
||||||
|
|
||||||
delete[] mTransparencyBitmap;
|
|
||||||
mTransparencyBitmap = nullptr;
|
|
||||||
@@ -2814,17 +2814,17 @@ nsWindow::OnButtonReleaseEvent(GdkEventB
|
|
||||||
LayoutDeviceIntPoint pos = event.mRefPoint;
|
|
||||||
|
|
||||||
nsEventStatus eventStatus = DispatchInputEvent(&event);
|
|
||||||
|
|
||||||
bool defaultPrevented = (eventStatus == nsEventStatus_eConsumeNoDefault);
|
|
||||||
// Check if mouse position in titlebar and doubleclick happened to
|
|
||||||
// trigger restore/maximize.
|
|
||||||
if (!defaultPrevented
|
|
||||||
- && mIsCSDEnabled
|
|
||||||
+ && mDrawInTitlebar
|
|
||||||
&& event.button == WidgetMouseEvent::eLeftButton
|
|
||||||
&& event.mClickCount == 2
|
|
||||||
&& mDraggableRegion.Contains(pos.x, pos.y)) {
|
|
||||||
|
|
||||||
if (mSizeState == nsSizeMode_Maximized) {
|
|
||||||
SetSizeMode(nsSizeMode_Normal);
|
|
||||||
} else {
|
|
||||||
SetSizeMode(nsSizeMode_Maximized);
|
|
||||||
@@ -3758,22 +3758,18 @@ nsWindow::Create(nsIWidget* aParent,
|
|
||||||
gtk_window_set_wmclass(GTK_WINDOW(mShell), "Toplevel",
|
|
||||||
gdk_get_program_class());
|
|
||||||
|
|
||||||
// each toplevel window gets its own window group
|
|
||||||
GtkWindowGroup *group = gtk_window_group_new();
|
|
||||||
gtk_window_group_add_window(group, GTK_WINDOW(mShell));
|
|
||||||
g_object_unref(group);
|
|
||||||
|
|
||||||
- int32_t isCSDAvailable = false;
|
|
||||||
- nsresult rv = LookAndFeel::GetInt(LookAndFeel::eIntID_GTKCSDAvailable,
|
|
||||||
- &isCSDAvailable);
|
|
||||||
- if (NS_SUCCEEDED(rv)) {
|
|
||||||
- mIsCSDAvailable = isCSDAvailable;
|
|
||||||
- }
|
|
||||||
+ // We enable titlebar rendering for toplevel windows only.
|
|
||||||
+ mCSDSupportLevel = GetSystemCSDSupportLevel();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create a container to hold child windows and child GtkWidgets.
|
|
||||||
GtkWidget *container = moz_container_new();
|
|
||||||
mContainer = MOZ_CONTAINER(container);
|
|
||||||
|
|
||||||
// "csd" style is set when widget is realized so we need to call
|
|
||||||
// it explicitly now.
|
|
||||||
@@ -3788,17 +3784,17 @@ nsWindow::Create(nsIWidget* aParent,
|
|
||||||
* are drawn by Gtk+ to mShell. Content is rendered to mContainer
|
|
||||||
* and we listen to the Gtk+ events on mContainer.
|
|
||||||
* 3) We're running on Wayland. All gecko content is rendered
|
|
||||||
* to mContainer and we listen to the Gtk+ events on mContainer.
|
|
||||||
*/
|
|
||||||
GtkStyleContext* style = gtk_widget_get_style_context(mShell);
|
|
||||||
drawToContainer =
|
|
||||||
!mIsX11Display ||
|
|
||||||
- (mIsCSDAvailable && GetCSDSupportLevel() == CSD_SUPPORT_CLIENT) ||
|
|
||||||
+ (mCSDSupportLevel == CSD_SUPPORT_CLIENT) ||
|
|
||||||
gtk_style_context_has_class(style, "csd");
|
|
||||||
eventWidget = (drawToContainer) ? container : mShell;
|
|
||||||
|
|
||||||
gtk_widget_add_events(eventWidget, kEvents);
|
|
||||||
if (drawToContainer)
|
|
||||||
gtk_widget_add_events(mShell, GDK_PROPERTY_CHANGE_MASK);
|
|
||||||
|
|
||||||
// Prevent GtkWindow from painting a background to avoid flickering.
|
|
||||||
@@ -6581,90 +6577,91 @@ nsWindow::ClearCachedResources()
|
|
||||||
window->ClearCachedResources();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
nsresult
|
|
||||||
nsWindow::SetNonClientMargins(LayoutDeviceIntMargin &aMargins)
|
|
||||||
{
|
|
||||||
- SetDrawsInTitlebar(aMargins.top == 0);
|
|
||||||
- return NS_OK;
|
|
||||||
+ SetDrawsInTitlebar(aMargins.top == 0);
|
|
||||||
+ return NS_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
nsWindow::SetDrawsInTitlebar(bool aState)
|
|
||||||
{
|
|
||||||
- if (!mIsCSDAvailable || aState == mIsCSDEnabled)
|
|
||||||
- return;
|
|
||||||
-
|
|
||||||
- if (mShell) {
|
|
||||||
- if (GetCSDSupportLevel() == CSD_SUPPORT_SYSTEM) {
|
|
||||||
- SetWindowDecoration(aState ? eBorderStyle_border : mBorderStyle);
|
|
||||||
- }
|
|
||||||
- else {
|
|
||||||
- /* Window manager does not support GDK_DECOR_BORDER,
|
|
||||||
- * emulate it by CSD.
|
|
||||||
- *
|
|
||||||
- * gtk_window_set_titlebar() works on unrealized widgets only,
|
|
||||||
- * we need to handle mShell carefully here.
|
|
||||||
- * When CSD is enabled mGdkWindow is owned by mContainer which is good
|
|
||||||
- * as we can't delete our mGdkWindow. To make mShell unrealized while
|
|
||||||
- * mContainer is preserved we temporary reparent mContainer to an
|
|
||||||
- * invisible GtkWindow.
|
|
||||||
- */
|
|
||||||
- NativeShow(false);
|
|
||||||
-
|
|
||||||
- // Using GTK_WINDOW_POPUP rather than
|
|
||||||
- // GTK_WINDOW_TOPLEVEL in the hope that POPUP results in less
|
|
||||||
- // initialization and window manager interaction.
|
|
||||||
- GtkWidget* tmpWindow = gtk_window_new(GTK_WINDOW_POPUP);
|
|
||||||
- gtk_widget_realize(tmpWindow);
|
|
||||||
-
|
|
||||||
- gtk_widget_reparent(GTK_WIDGET(mContainer), tmpWindow);
|
|
||||||
- gtk_widget_unrealize(GTK_WIDGET(mShell));
|
|
||||||
-
|
|
||||||
- // Available as of GTK 3.10+
|
|
||||||
- static auto sGtkWindowSetTitlebar = (void (*)(GtkWindow*, GtkWidget*))
|
|
||||||
- dlsym(RTLD_DEFAULT, "gtk_window_set_titlebar");
|
|
||||||
- MOZ_ASSERT(sGtkWindowSetTitlebar,
|
|
||||||
- "Missing gtk_window_set_titlebar(), old Gtk+ library?");
|
|
||||||
-
|
|
||||||
- if (aState) {
|
|
||||||
- // Add a hidden titlebar widget to trigger CSD, but disable the default
|
|
||||||
- // titlebar. GtkFixed is a somewhat random choice for a simple unused
|
|
||||||
- // widget. gtk_window_set_titlebar() takes ownership of the titlebar
|
|
||||||
- // widget.
|
|
||||||
- sGtkWindowSetTitlebar(GTK_WINDOW(mShell), gtk_fixed_new());
|
|
||||||
- } else {
|
|
||||||
- sGtkWindowSetTitlebar(GTK_WINDOW(mShell), nullptr);
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- /* A workaround for https://bugzilla.gnome.org/show_bug.cgi?id=791081
|
|
||||||
- * gtk_widget_realize() throws:
|
|
||||||
- * "In pixman_region32_init_rect: Invalid rectangle passed"
|
|
||||||
- * when mShell has default 1x1 size.
|
|
||||||
- */
|
|
||||||
- GtkAllocation allocation = {0, 0, 0, 0};
|
|
||||||
- gtk_widget_get_preferred_width(GTK_WIDGET(mShell), nullptr,
|
|
||||||
- &allocation.width);
|
|
||||||
- gtk_widget_get_preferred_height(GTK_WIDGET(mShell), nullptr,
|
|
||||||
- &allocation.height);
|
|
||||||
- gtk_widget_size_allocate(GTK_WIDGET(mShell), &allocation);
|
|
||||||
-
|
|
||||||
- gtk_widget_realize(GTK_WIDGET(mShell));
|
|
||||||
- gtk_widget_reparent(GTK_WIDGET(mContainer), GTK_WIDGET(mShell));
|
|
||||||
- mNeedsShow = true;
|
|
||||||
- NativeResize();
|
|
||||||
-
|
|
||||||
- gtk_widget_destroy(tmpWindow);
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- mIsCSDEnabled = aState;
|
|
||||||
+ if (!mShell ||
|
|
||||||
+ mCSDSupportLevel == CSD_SUPPORT_NONE ||
|
|
||||||
+ aState == mDrawInTitlebar) {
|
|
||||||
+ return;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (mCSDSupportLevel == CSD_SUPPORT_SYSTEM) {
|
|
||||||
+ SetWindowDecoration(aState ? eBorderStyle_border : mBorderStyle);
|
|
||||||
+ }
|
|
||||||
+ else if (mCSDSupportLevel == CSD_SUPPORT_CLIENT) {
|
|
||||||
+ /* Window manager does not support GDK_DECOR_BORDER,
|
|
||||||
+ * emulate it by CSD.
|
|
||||||
+ *
|
|
||||||
+ * gtk_window_set_titlebar() works on unrealized widgets only,
|
|
||||||
+ * we need to handle mShell carefully here.
|
|
||||||
+ * When CSD is enabled mGdkWindow is owned by mContainer which is good
|
|
||||||
+ * as we can't delete our mGdkWindow. To make mShell unrealized while
|
|
||||||
+ * mContainer is preserved we temporary reparent mContainer to an
|
|
||||||
+ * invisible GtkWindow.
|
|
||||||
+ */
|
|
||||||
+ NativeShow(false);
|
|
||||||
+
|
|
||||||
+ // Using GTK_WINDOW_POPUP rather than
|
|
||||||
+ // GTK_WINDOW_TOPLEVEL in the hope that POPUP results in less
|
|
||||||
+ // initialization and window manager interaction.
|
|
||||||
+ GtkWidget* tmpWindow = gtk_window_new(GTK_WINDOW_POPUP);
|
|
||||||
+ gtk_widget_realize(tmpWindow);
|
|
||||||
+
|
|
||||||
+ gtk_widget_reparent(GTK_WIDGET(mContainer), tmpWindow);
|
|
||||||
+ gtk_widget_unrealize(GTK_WIDGET(mShell));
|
|
||||||
+
|
|
||||||
+ // Available as of GTK 3.10+
|
|
||||||
+ static auto sGtkWindowSetTitlebar = (void (*)(GtkWindow*, GtkWidget*))
|
|
||||||
+ dlsym(RTLD_DEFAULT, "gtk_window_set_titlebar");
|
|
||||||
+ MOZ_ASSERT(sGtkWindowSetTitlebar,
|
|
||||||
+ "Missing gtk_window_set_titlebar(), old Gtk+ library?");
|
|
||||||
+
|
|
||||||
+ if (aState) {
|
|
||||||
+ // Add a hidden titlebar widget to trigger CSD, but disable the default
|
|
||||||
+ // titlebar. GtkFixed is a somewhat random choice for a simple unused
|
|
||||||
+ // widget. gtk_window_set_titlebar() takes ownership of the titlebar
|
|
||||||
+ // widget.
|
|
||||||
+ sGtkWindowSetTitlebar(GTK_WINDOW(mShell), gtk_fixed_new());
|
|
||||||
+ } else {
|
|
||||||
+ sGtkWindowSetTitlebar(GTK_WINDOW(mShell), nullptr);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* A workaround for https://bugzilla.gnome.org/show_bug.cgi?id=791081
|
|
||||||
+ * gtk_widget_realize() throws:
|
|
||||||
+ * "In pixman_region32_init_rect: Invalid rectangle passed"
|
|
||||||
+ * when mShell has default 1x1 size.
|
|
||||||
+ */
|
|
||||||
+ GtkAllocation allocation = {0, 0, 0, 0};
|
|
||||||
+ gtk_widget_get_preferred_width(GTK_WIDGET(mShell), nullptr,
|
|
||||||
+ &allocation.width);
|
|
||||||
+ gtk_widget_get_preferred_height(GTK_WIDGET(mShell), nullptr,
|
|
||||||
+ &allocation.height);
|
|
||||||
+ gtk_widget_size_allocate(GTK_WIDGET(mShell), &allocation);
|
|
||||||
+
|
|
||||||
+ gtk_widget_realize(GTK_WIDGET(mShell));
|
|
||||||
+ gtk_widget_reparent(GTK_WIDGET(mContainer), GTK_WIDGET(mShell));
|
|
||||||
+ mNeedsShow = true;
|
|
||||||
+ NativeResize();
|
|
||||||
+
|
|
||||||
+ gtk_widget_destroy(tmpWindow);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ mDrawInTitlebar = aState;
|
|
||||||
}
|
|
||||||
|
|
||||||
gint
|
|
||||||
nsWindow::GdkScaleFactor()
|
|
||||||
{
|
|
||||||
#if (MOZ_WIDGET_GTK >= 3)
|
|
||||||
// Available as of GTK 3.10+
|
|
||||||
static auto sGdkWindowGetScaleFactorPtr = (gint (*)(GdkWindow*))
|
|
||||||
@@ -6923,28 +6920,28 @@ nsWindow::SynthesizeNativeTouchPoint(uin
|
|
||||||
event.touch.y = DevicePixelsToGdkCoordRoundDown(pointInWindow.y);
|
|
||||||
|
|
||||||
gdk_event_put(&event);
|
|
||||||
|
|
||||||
return NS_OK;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-bool
|
|
||||||
-nsWindow::DoDrawTitlebar() const
|
|
||||||
-{
|
|
||||||
- return mIsCSDEnabled && mSizeState == nsSizeMode_Normal;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
nsWindow::CSDSupportLevel
|
|
||||||
-nsWindow::GetCSDSupportLevel() {
|
|
||||||
+nsWindow::GetSystemCSDSupportLevel() {
|
|
||||||
if (sCSDSupportLevel != CSD_SUPPORT_UNKNOWN) {
|
|
||||||
return sCSDSupportLevel;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ // Require GTK 3.10 for GtkHeaderBar support and compatible window manager.
|
|
||||||
+ if (gtk_check_version(3, 10, 0) != nullptr) {
|
|
||||||
+ sCSDSupportLevel = CSD_SUPPORT_NONE;
|
|
||||||
+ return sCSDSupportLevel;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
const char* currentDesktop = getenv("XDG_CURRENT_DESKTOP");
|
|
||||||
if (currentDesktop) {
|
|
||||||
// GNOME Flashback (fallback)
|
|
||||||
if (strstr(currentDesktop, "GNOME-Flashback:GNOME") != nullptr) {
|
|
||||||
sCSDSupportLevel = CSD_SUPPORT_CLIENT;
|
|
||||||
// gnome-shell
|
|
||||||
} else if (strstr(currentDesktop, "GNOME") != nullptr) {
|
|
||||||
sCSDSupportLevel = CSD_SUPPORT_SYSTEM;
|
|
||||||
diff -up firefox-60.0/widget/gtk/gtk3drawing.cpp.orig firefox-60.0/widget/gtk/gtk3drawing.cpp
|
|
||||||
--- firefox-60.0/widget/gtk/gtk3drawing.cpp.orig 2018-04-26 22:07:36.000000000 +0200
|
|
||||||
+++ firefox-60.0/widget/gtk/gtk3drawing.cpp 2018-04-30 13:38:19.083949868 +0200
|
|
||||||
@@ -38,6 +38,16 @@ static ToolbarGTKMetrics sToolbarMetrics
|
|
||||||
#define GTK_STATE_FLAG_CHECKED (1 << 11)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
+static GtkBorder
|
|
||||||
+operator+=(GtkBorder& first, const GtkBorder& second)
|
|
||||||
+{
|
|
||||||
+ first.left += second.left;
|
|
||||||
+ first.right += second.right;
|
|
||||||
+ first.top += second.top;
|
|
||||||
+ first.bottom += second.bottom;
|
|
||||||
+ return first;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
static gint
|
|
||||||
moz_gtk_get_tab_thickness(GtkStyleContext *style);
|
|
||||||
|
|
||||||
@@ -3056,6 +3066,76 @@ GetScrollbarMetrics(GtkOrientation aOrie
|
|
||||||
return metrics;
|
|
||||||
}
|
|
||||||
|
|
||||||
+/*
|
|
||||||
+ * get_shadow_width() from gtkwindow.c is not public so we need
|
|
||||||
+ * to implement it.
|
|
||||||
+ */
|
|
||||||
+bool
|
|
||||||
+GetCSDDecorationSize(GtkWindow *aGtkWindow, GtkBorder* aDecorationSize)
|
|
||||||
+{
|
|
||||||
+ GtkStyleContext* context = gtk_widget_get_style_context(GTK_WIDGET(aGtkWindow));
|
|
||||||
+ bool solidDecorations = gtk_style_context_has_class(context, "solid-csd");
|
|
||||||
+ context = GetStyleContext(solidDecorations ?
|
|
||||||
+ MOZ_GTK_WINDOW_DECORATION_SOLID :
|
|
||||||
+ MOZ_GTK_WINDOW_DECORATION);
|
|
||||||
+
|
|
||||||
+ /* Always sum border + padding */
|
|
||||||
+ GtkBorder padding;
|
|
||||||
+ GtkStateFlags state = gtk_style_context_get_state(context);
|
|
||||||
+ gtk_style_context_get_border(context, state, aDecorationSize);
|
|
||||||
+ gtk_style_context_get_padding(context, state, &padding);
|
|
||||||
+ *aDecorationSize += padding;
|
|
||||||
+
|
|
||||||
+ // Available on GTK 3.20+.
|
|
||||||
+ static auto sGtkRenderBackgroundGetClip =
|
|
||||||
+ (void (*)(GtkStyleContext*, gdouble, gdouble, gdouble, gdouble, GdkRectangle*))
|
|
||||||
+ dlsym(RTLD_DEFAULT, "gtk_render_background_get_clip");
|
|
||||||
+
|
|
||||||
+ GtkBorder margin;
|
|
||||||
+ gtk_style_context_get_margin(context, state, &margin);
|
|
||||||
+
|
|
||||||
+ GtkBorder extents = {0, 0, 0, 0};
|
|
||||||
+ if (sGtkRenderBackgroundGetClip) {
|
|
||||||
+ /* Get shadow extents but combine with style margin; use the bigger value.
|
|
||||||
+ */
|
|
||||||
+ GdkRectangle clip;
|
|
||||||
+ sGtkRenderBackgroundGetClip(context, 0, 0, 0, 0, &clip);
|
|
||||||
+
|
|
||||||
+ extents.top = -clip.y;
|
|
||||||
+ extents.right = clip.width + clip.x;
|
|
||||||
+ extents.bottom = clip.height + clip.y;
|
|
||||||
+ extents.left = -clip.x;
|
|
||||||
+
|
|
||||||
+ // Margin is used for resize grip size - it's not present on
|
|
||||||
+ // popup windows.
|
|
||||||
+ if (gtk_window_get_window_type(aGtkWindow) != GTK_WINDOW_POPUP) {
|
|
||||||
+ extents.top = MAX(extents.top, margin.top);
|
|
||||||
+ extents.right = MAX(extents.right, margin.right);
|
|
||||||
+ extents.bottom = MAX(extents.bottom, margin.bottom);
|
|
||||||
+ extents.left = MAX(extents.left, margin.left);
|
|
||||||
+ }
|
|
||||||
+ } else {
|
|
||||||
+ /* If we can't get shadow extents use decoration-resize-handle instead
|
|
||||||
+ * as a workaround. This is inspired by update_border_windows()
|
|
||||||
+ * from gtkwindow.c although this is not 100% accurate as we emulate
|
|
||||||
+ * the extents here.
|
|
||||||
+ */
|
|
||||||
+ gint handle;
|
|
||||||
+ gtk_widget_style_get(GetWidget(MOZ_GTK_WINDOW),
|
|
||||||
+ "decoration-resize-handle", &handle,
|
|
||||||
+ NULL);
|
|
||||||
+
|
|
||||||
+ extents.top = handle + margin.top;
|
|
||||||
+ extents.right = handle + margin.right;
|
|
||||||
+ extents.bottom = handle + margin.bottom;
|
|
||||||
+ extents.left = handle + margin.left;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ *aDecorationSize += extents;
|
|
||||||
+
|
|
||||||
+ return (sGtkRenderBackgroundGetClip != nullptr);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* cairo_t *cr argument has to be a system-cairo. */
|
|
||||||
gint
|
|
||||||
moz_gtk_widget_paint(WidgetNodeType widget, cairo_t *cr,
|
|
||||||
diff -up firefox-60.0/widget/gtk/gtkdrawing.h.orig firefox-60.0/widget/gtk/gtkdrawing.h
|
|
||||||
--- firefox-60.0/widget/gtk/gtkdrawing.h.orig 2018-04-26 22:07:35.000000000 +0200
|
|
||||||
+++ firefox-60.0/widget/gtk/gtkdrawing.h 2018-04-30 13:38:19.083949868 +0200
|
|
||||||
@@ -334,6 +334,10 @@ typedef enum {
|
|
||||||
*/
|
|
||||||
MOZ_GTK_HEADER_BAR_BUTTON_MAXIMIZE_RESTORE,
|
|
||||||
|
|
||||||
+ /* Client-side window decoration node. Available on GTK 3.20+. */
|
|
||||||
+ MOZ_GTK_WINDOW_DECORATION,
|
|
||||||
+ MOZ_GTK_WINDOW_DECORATION_SOLID,
|
|
||||||
+
|
|
||||||
MOZ_GTK_WIDGET_NODE_COUNT
|
|
||||||
} WidgetNodeType;
|
|
||||||
|
|
||||||
@@ -606,4 +610,17 @@ GetToolbarButtonMetrics(WidgetNodeType a
|
|
||||||
int
|
|
||||||
GetGtkHeaderBarButtonLayout(WidgetNodeType* aButtonLayout, int aMaxButtonNums);
|
|
||||||
|
|
||||||
+/**
|
|
||||||
+ * Get size of CSD window extents of given GtkWindow.
|
|
||||||
+ *
|
|
||||||
+ * aGtkWindow [IN] Decorated window.
|
|
||||||
+ * aDecorationSize [OUT] Returns calculated (or estimated) decoration
|
|
||||||
+ * size of given aGtkWindow.
|
|
||||||
+ *
|
|
||||||
+ * returns: True if we have extract decoration size (for GTK 3.20+)
|
|
||||||
+ * False if we have only an estimation (for GTK+ before 3.20+)
|
|
||||||
+ */
|
|
||||||
+bool
|
|
||||||
+GetCSDDecorationSize(GtkWindow *aGtkWindow, GtkBorder* aDecorationSize);
|
|
||||||
+
|
|
||||||
#endif
|
|
||||||
diff -up firefox-60.0/widget/gtk/nsWindow.cpp.orig firefox-60.0/widget/gtk/nsWindow.cpp
|
|
||||||
--- firefox-60.0/widget/gtk/nsWindow.cpp.orig 2018-04-30 13:37:32.145122854 +0200
|
|
||||||
+++ firefox-60.0/widget/gtk/nsWindow.cpp 2018-04-30 13:39:12.593752681 +0200
|
|
||||||
@@ -127,6 +127,7 @@ using namespace mozilla::widget;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "nsShmImage.h"
|
|
||||||
+#include "gtkdrawing.h"
|
|
||||||
|
|
||||||
#include "nsIDOMWheelEvent.h"
|
|
||||||
|
|
||||||
@@ -3360,6 +3361,10 @@ nsWindow::OnWindowStateEvent(GtkWidget *
|
|
||||||
aEvent->new_window_state & GDK_WINDOW_STATE_FULLSCREEN);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+
|
|
||||||
+ if (mDrawInTitlebar && mCSDSupportLevel == CSD_SUPPORT_CLIENT) {
|
|
||||||
+ UpdateClientOffsetForCSDWindow();
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
@@ -6552,6 +6557,32 @@ nsWindow::ClearCachedResources()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* nsWindow::UpdateClientOffsetForCSDWindow() is designed to be called from
|
|
||||||
+ * paint code to update mClientOffset any time. It also propagates
|
|
||||||
+ * the mClientOffset to child tabs.
|
|
||||||
+ *
|
|
||||||
+ * It works only for CSD decorated GtkWindow.
|
|
||||||
+ */
|
|
||||||
+void
|
|
||||||
+nsWindow::UpdateClientOffsetForCSDWindow()
|
|
||||||
+{
|
|
||||||
+ // _NET_FRAME_EXTENTS is not set on client decorated windows,
|
|
||||||
+ // so we need to read offset between mContainer and toplevel mShell
|
|
||||||
+ // window.
|
|
||||||
+ if (mSizeState == nsSizeMode_Normal) {
|
|
||||||
+ GtkBorder decorationSize;
|
|
||||||
+ GetCSDDecorationSize(GTK_WINDOW(mShell), &decorationSize);
|
|
||||||
+ mClientOffset = nsIntPoint(decorationSize.left, decorationSize.top);
|
|
||||||
+ } else {
|
|
||||||
+ mClientOffset = nsIntPoint(0, 0);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ // Send a WindowMoved notification. This ensures that TabParent
|
|
||||||
+ // picks up the new client offset and sends it to the child process
|
|
||||||
+ // if appropriate.
|
|
||||||
+ NotifyWindowMoved(mBounds.x, mBounds.y);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
nsresult
|
|
||||||
nsWindow::SetNonClientMargins(LayoutDeviceIntMargin &aMargins)
|
|
||||||
{
|
|
||||||
@@ -6626,6 +6657,13 @@ nsWindow::SetDrawsInTitlebar(bool aState
|
|
||||||
mNeedsShow = true;
|
|
||||||
NativeResize();
|
|
||||||
|
|
||||||
+ // When we use system titlebar setup managed by Gtk+ we also get
|
|
||||||
+ // _NET_FRAME_EXTENTS property for our toplevel window so we can't
|
|
||||||
+ // update the client offset it here.
|
|
||||||
+ if (aState) {
|
|
||||||
+ UpdateClientOffsetForCSDWindow();
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
gtk_widget_destroy(tmpWindow);
|
|
||||||
}
|
|
||||||
|
|
||||||
diff -up firefox-60.0/widget/gtk/nsWindow.h.orig firefox-60.0/widget/gtk/nsWindow.h
|
|
||||||
--- firefox-60.0/widget/gtk/nsWindow.h.orig 2018-04-30 13:37:32.143122861 +0200
|
|
||||||
+++ firefox-60.0/widget/gtk/nsWindow.h 2018-04-30 13:38:19.085949861 +0200
|
|
||||||
@@ -454,6 +454,8 @@ private:
|
|
||||||
nsIWidgetListener* GetListener();
|
|
||||||
bool IsComposited() const;
|
|
||||||
|
|
||||||
+ void UpdateClientOffsetForCSDWindow();
|
|
||||||
+
|
|
||||||
GtkWidget *mShell;
|
|
||||||
MozContainer *mContainer;
|
|
||||||
GdkWindow *mGdkWindow;
|
|
||||||
diff -up firefox-60.0/widget/gtk/WidgetStyleCache.cpp.orig firefox-60.0/widget/gtk/WidgetStyleCache.cpp
|
|
||||||
--- firefox-60.0/widget/gtk/WidgetStyleCache.cpp.orig 2018-04-26 22:07:35.000000000 +0200
|
|
||||||
+++ firefox-60.0/widget/gtk/WidgetStyleCache.cpp 2018-04-30 13:38:19.085949861 +0200
|
|
||||||
@@ -1285,6 +1285,22 @@ GetCssNodeStyleInternal(WidgetNodeType a
|
|
||||||
"MOZ_GTK_HEADER_BAR_BUTTON_RESTORE is used as an icon only!");
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
||||||
+ case MOZ_GTK_WINDOW_DECORATION:
|
|
||||||
+ {
|
|
||||||
+ GtkStyleContext* parentStyle =
|
|
||||||
+ CreateSubStyleWithClass(MOZ_GTK_WINDOW, "csd");
|
|
||||||
+ style = CreateCSSNode("decoration", parentStyle);
|
|
||||||
+ g_object_unref(parentStyle);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
+ case MOZ_GTK_WINDOW_DECORATION_SOLID:
|
|
||||||
+ {
|
|
||||||
+ GtkStyleContext* parentStyle =
|
|
||||||
+ CreateSubStyleWithClass(MOZ_GTK_WINDOW, "solid-csd");
|
|
||||||
+ style = CreateCSSNode("decoration", parentStyle);
|
|
||||||
+ g_object_unref(parentStyle);
|
|
||||||
+ break;
|
|
||||||
+ }
|
|
||||||
default:
|
|
||||||
return GetWidgetRootStyle(aNodeType);
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +0,0 @@
|
|||||||
diff --git i/config/baseconfig.mk w/config/baseconfig.mk
|
|
||||||
index e204533ac9b66b88..27ae154ce265ca2b 100644
|
|
||||||
--- i/config/baseconfig.mk
|
|
||||||
+++ w/config/baseconfig.mk
|
|
||||||
@@ -4,7 +4,7 @@
|
|
||||||
# whether a normal build is happening or whether the check is running.
|
|
||||||
includedir := $(includedir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
|
|
||||||
idldir = $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
|
|
||||||
-installdir = $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
|
|
||||||
+installdir = $(libdir)/$(MOZ_APP_NAME)
|
|
||||||
sdkdir = $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
|
|
||||||
ifeq (.,$(DEPTH))
|
|
||||||
DIST = dist
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,60 +0,0 @@
|
|||||||
diff -Nuar a/build/autoconf/icu.m4 b/build/autoconf/icu.m4
|
|
||||||
--- a/build/autoconf/icu.m4 2017-09-14 23:15:53.000000000 +0300
|
|
||||||
+++ b/build/autoconf/icu.m4 2018-01-19 18:45:55.713445653 +0300
|
|
||||||
@@ -15,7 +15,7 @@
|
|
||||||
MOZ_SYSTEM_ICU=1)
|
|
||||||
|
|
||||||
if test -n "$MOZ_SYSTEM_ICU"; then
|
|
||||||
- PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 59.1)
|
|
||||||
+ PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 58.2)
|
|
||||||
CFLAGS="$CFLAGS $MOZ_ICU_CFLAGS"
|
|
||||||
CXXFLAGS="$CXXFLAGS $MOZ_ICU_CFLAGS"
|
|
||||||
fi
|
|
||||||
diff -Nuar a/old-configure b/old-configure
|
|
||||||
--- a/old-configure 2018-01-19 02:55:53.000000000 +0300
|
|
||||||
+++ b/old-configure 2018-01-19 18:45:13.792448678 +0300
|
|
||||||
@@ -17589,29 +17589,29 @@
|
|
||||||
else
|
|
||||||
PKG_CONFIG_MIN_VERSION=0.9.0
|
|
||||||
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
|
|
||||||
- echo $ac_n "checking for icu-i18n >= 59.1""... $ac_c" 1>&6
|
|
||||||
-echo "configure:17594: checking for icu-i18n >= 59.1" >&5
|
|
||||||
+ echo $ac_n "checking for icu-i18n >= 58.2""... $ac_c" 1>&6
|
|
||||||
+echo "configure:17594: checking for icu-i18n >= 58.2" >&5
|
|
||||||
|
|
||||||
- if $PKG_CONFIG --exists "icu-i18n >= 59.1" ; then
|
|
||||||
+ if $PKG_CONFIG --exists "icu-i18n >= 58.2" ; then
|
|
||||||
echo "$ac_t""yes" 1>&6
|
|
||||||
succeeded=yes
|
|
||||||
|
|
||||||
echo $ac_n "checking MOZ_ICU_CFLAGS""... $ac_c" 1>&6
|
|
||||||
echo "configure:17601: checking MOZ_ICU_CFLAGS" >&5
|
|
||||||
- MOZ_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n >= 59.1"`
|
|
||||||
+ MOZ_ICU_CFLAGS=`$PKG_CONFIG --cflags "icu-i18n >= 58.2"`
|
|
||||||
echo "$ac_t""$MOZ_ICU_CFLAGS" 1>&6
|
|
||||||
|
|
||||||
echo $ac_n "checking MOZ_ICU_LIBS""... $ac_c" 1>&6
|
|
||||||
echo "configure:17606: checking MOZ_ICU_LIBS" >&5
|
|
||||||
## Remove evil flags like -Wl,--export-dynamic
|
|
||||||
- MOZ_ICU_LIBS="`$PKG_CONFIG --libs \"icu-i18n >= 59.1\" |sed s/-Wl,--export-dynamic//g`"
|
|
||||||
+ MOZ_ICU_LIBS="`$PKG_CONFIG --libs \"icu-i18n >= 58.2\" |sed s/-Wl,--export-dynamic//g`"
|
|
||||||
echo "$ac_t""$MOZ_ICU_LIBS" 1>&6
|
|
||||||
else
|
|
||||||
MOZ_ICU_CFLAGS=""
|
|
||||||
MOZ_ICU_LIBS=""
|
|
||||||
## If we have a custom action on failure, don't print errors, but
|
|
||||||
## do set a variable so people can do so.
|
|
||||||
- MOZ_ICU_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "icu-i18n >= 59.1"`
|
|
||||||
+ MOZ_ICU_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "icu-i18n >= 58.2"`
|
|
||||||
echo $MOZ_ICU_PKG_ERRORS
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -17627,7 +17627,7 @@
|
|
||||||
:
|
|
||||||
else
|
|
||||||
if test "$COMPILE_ENVIRONMENT"; then
|
|
||||||
- { echo "configure: error: Library requirements (icu-i18n >= 59.1) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; echo "configure: error: Library requirements (icu-i18n >= 59.1) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&5; exit 1; }
|
|
||||||
+ { echo "configure: error: Library requirements (icu-i18n >= 58.2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&2; echo "configure: error: Library requirements (icu-i18n >= 58.2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them." 1>&5; exit 1; }
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
diff -Nuar a/toolkit/moz.configure b/toolkit/moz.configure
|
|
||||||
--- a/toolkit/moz.configure 2017-11-16 13:38:11.571875852 +0300
|
|
||||||
+++ b/toolkit/moz.configure 2017-11-16 13:35:29.679887533 +0300
|
|
||||||
@@ -618,7 +618,7 @@
|
|
||||||
@imports('os')
|
|
||||||
@imports('subprocess')
|
|
||||||
def llvm_config_paths(host):
|
|
||||||
- llvm_supported_versions = ['6.0', '5.0', '4.0', '3.9']
|
|
||||||
+ llvm_supported_versions = ['6.0', '5.0', '4.0', '3.9', '3.8']
|
|
||||||
llvm_config_progs = []
|
|
||||||
for version in llvm_supported_versions:
|
|
||||||
llvm_config_progs += [
|
|
||||||
@@ -662,9 +662,9 @@
|
|
||||||
|
|
||||||
with only_when(building_stylo_bindgen):
|
|
||||||
option('--with-libclang-path', nargs=1,
|
|
||||||
- help='Absolute path to a directory containing Clang/LLVM libraries for Stylo (version 3.9.x or above)')
|
|
||||||
+ help='Absolute path to a directory containing Clang/LLVM libraries for Stylo (version 3.8.x or above)')
|
|
||||||
option('--with-clang-path', nargs=1,
|
|
||||||
- help='Absolute path to a Clang binary for Stylo bindgen (version 3.9.x or above)')
|
|
||||||
+ help='Absolute path to a Clang binary for Stylo bindgen (version 3.8.x or above)')
|
|
||||||
|
|
||||||
def invoke_llvm_config(llvm_config, *options):
|
|
||||||
'''Invoke llvm_config with the given options and return the first line of
|
|
||||||
@@ -675,7 +675,7 @@
|
|
||||||
@imports(_from='textwrap', _import='dedent')
|
|
||||||
def check_minimum_llvm_config_version(llvm_config):
|
|
||||||
version = Version(invoke_llvm_config(llvm_config, '--version'))
|
|
||||||
- min_version = Version('3.9.0')
|
|
||||||
+ min_version = Version('3.8.0')
|
|
||||||
if version < min_version:
|
|
||||||
die(dedent('''\
|
|
||||||
llvm installation {} is incompatible with Stylo bindgen.
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
--- a/toolkit/modules/CertUtils.jsm
|
|
||||||
+++ b/toolkit/modules/CertUtils.jsm
|
|
||||||
@@ -170,17 +170,19 @@ this.checkCert =
|
|
||||||
issuerCert = issuerCert.QueryInterface(Ci.nsIX509Cert3);
|
|
||||||
var tokenNames = issuerCert.getAllTokenNames({});
|
|
||||||
|
|
||||||
if (!tokenNames || !tokenNames.some(isBuiltinToken))
|
|
||||||
throw new Ce(certNotBuiltInErr, Cr.NS_ERROR_ABORT);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isBuiltinToken(tokenName) {
|
|
||||||
- return tokenName == "Builtin Object Token";
|
|
||||||
+ return tokenName == "Builtin Object Token" ||
|
|
||||||
+ tokenName == "Default Trust" ||
|
|
||||||
+ tokenName == "System Trust";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This class implements nsIBadCertListener. Its job is to prevent "bad cert"
|
|
||||||
* security dialogs from being shown to the user. It is better to simply fail
|
|
||||||
* if the certificate is bad. See bug 304286.
|
|
||||||
*
|
|
||||||
* @param aAllowNonBuiltInCerts (optional)
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
diff -Nuar a/build/moz.configure/rust.configure b/build/moz.configure/rust.configure
|
|
||||||
--- a/build/moz.configure/rust.configure 2018-01-11 23:16:54.000000000 +0300
|
|
||||||
+++ b/build/moz.configure/rust.configure 2018-01-20 11:41:47.109584234 +0300
|
|
||||||
@@ -58,7 +58,7 @@
|
|
||||||
You can install rust by running './mach bootstrap'
|
|
||||||
or by directly running the installer from https://rustup.rs/
|
|
||||||
'''))
|
|
||||||
- rustc_min_version = Version('1.21.0')
|
|
||||||
+ rustc_min_version = Version('1.20.0')
|
|
||||||
cargo_min_version = Version('0.{}'.format(rustc_min_version.minor + 1))
|
|
||||||
|
|
||||||
version = rustc_info.version
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
--- a/build/autoconf/icu.m4
|
|
||||||
+++ b/build/autoconf/icu.m4
|
|
||||||
@@ -64,17 +64,17 @@ if test -n "$USE_ICU"; then
|
|
||||||
icudir="$_topsrcdir/intl/icu/source"
|
|
||||||
if test ! -d "$icudir"; then
|
|
||||||
icudir="$_topsrcdir/../../intl/icu/source"
|
|
||||||
if test ! -d "$icudir"; then
|
|
||||||
AC_MSG_ERROR([Cannot find the ICU directory])
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
- version=`sed -n 's/^[[:space:]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"`
|
|
||||||
+ version=`sed -n 's/^[[[:space:]]]*#[[:space:]]*define[[:space:]][[:space:]]*U_ICU_VERSION_MAJOR_NUM[[:space:]][[:space:]]*\([0-9][0-9]*\)[[:space:]]*$/\1/p' "$icudir/common/unicode/uvernum.h"`
|
|
||||||
if test x"$version" = x; then
|
|
||||||
AC_MSG_ERROR([cannot determine icu version number from uvernum.h header file $lineno])
|
|
||||||
fi
|
|
||||||
MOZ_ICU_VERSION="$version"
|
|
||||||
|
|
||||||
# TODO: the l is actually endian-dependent
|
|
||||||
# We could make this set as 'l' or 'b' for little or big, respectively,
|
|
||||||
# but we'd need to check in a big-endian version of the file.
|
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
<IsA>app:gui</IsA>
|
<IsA>app:gui</IsA>
|
||||||
<Summary>Firefox Web Browser</Summary>
|
<Summary>Firefox Web Browser</Summary>
|
||||||
<Description>It is more secure and faster to browse the web with Firefox web browser. You can personalize your web browser with many specifications that is not enough to explain in two sentences.</Description>
|
<Description>It is more secure and faster to browse the web with Firefox web browser. You can personalize your web browser with many specifications that is not enough to explain in two sentences.</Description>
|
||||||
<Archive sha1sum="8d8d1854a5bf53328ea24c3648e3027cf39149c2" type="tarxz">https://ftp.mozilla.org/pub/firefox/releases/95.0.1/source/firefox-95.0.1.source.tar.xz</Archive>
|
<Archive sha1sum="740b4cf410dc1b63ca507921c28afed7a8c8b080" type="tarxz">https://ftp.mozilla.org/pub/firefox/releases/96.0/source/firefox-96.0.source.tar.xz</Archive>
|
||||||
<AdditionalFiles>
|
<AdditionalFiles>
|
||||||
<!--Our main configure script. Configure paramters are stored here.-->
|
<!--Our main configure script. Configure paramters are stored here.-->
|
||||||
<!-- <AdditionalFile target=".mozconfig" permission="0644">mozconfig</AdditionalFile> -->
|
<!-- <AdditionalFile target=".mozconfig" permission="0644">mozconfig</AdditionalFile> -->
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
<Dependency>util-linux</Dependency>
|
<Dependency>util-linux</Dependency>
|
||||||
</BuildDependencies>
|
</BuildDependencies>
|
||||||
<Patches>
|
<Patches>
|
||||||
<Patch level="1">0002-Bug-1745560-Add-missing-stub-for-wl_proxy_marshal_fl.patch</Patch>
|
<!-- <Patch level="1">0002-Bug-1745560-Add-missing-stub-for-wl_proxy_marshal_fl.patch</Patch> -->
|
||||||
</Patches>
|
</Patches>
|
||||||
</Source>
|
</Source>
|
||||||
|
|
||||||
@@ -558,6 +558,13 @@
|
|||||||
</Package>
|
</Package>
|
||||||
|
|
||||||
<History>
|
<History>
|
||||||
|
<Update release="69">
|
||||||
|
<Date>2022-01-10</Date>
|
||||||
|
<Version>96.0</Version>
|
||||||
|
<Comment>Version bump.</Comment>
|
||||||
|
<Name>Mustafa Cinasal</Name>
|
||||||
|
<Email>muscnsl@gmail.com</Email>
|
||||||
|
</Update>
|
||||||
<Update release="68">
|
<Update release="68">
|
||||||
<Date>2021-12-16</Date>
|
<Date>2021-12-16</Date>
|
||||||
<Version>95.0.1</Version>
|
<Version>95.0.1</Version>
|
||||||
|
|||||||
Reference in New Issue
Block a user