Skip to content

Commit 6111cf1

Browse files
committed
fix: Shift navbar down when accesing it on macOS in fullscreen (#8757)
1 parent 0dbfca8 commit 6111cf1

File tree

2 files changed

+31
-14
lines changed

2 files changed

+31
-14
lines changed

src/browser/base/content/browser-fullScreenAndPointerLock-js.patch

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ diff --git a/browser/base/content/browser-fullScreenAndPointerLock.js b/browser/
22
index b41449d4c4bc373a4c9cf449c0bb370bfdbc20d6..f1166929397dd39b7f44bd9cb0d62a45d67f0e1d 100644
33
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
44
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
5-
@@ -427,10 +427,10 @@ var FullScreen = {
5+
@@ -426,10 +426,10 @@ var FullScreen = {
6+
shiftSize = shiftSize.toFixed(2);
67
gNavToolbox.classList.toggle("fullscreen-with-menubar", shiftSize > 0);
78

8-
let transform = shiftSize > 0 ? `translateY(${shiftSize}px)` : "";
9+
- let transform = shiftSize > 0 ? `translateY(${shiftSize}px)` : "";
910
- gNavToolbox.style.transform = transform;
1011
- gURLBar.textbox.style.transform = gURLBar.textbox.hasAttribute("breakout")
1112
- ? transform
12-
- : "";
13-
+ //gNavToolbox.style.transform = transform;
14-
+ //gURLBar.textbox.style.transform = gURLBar.textbox.hasAttribute("breakout")
15-
+ // ? transform
16-
+ // : "";
13+
+ const padding = shiftSize > 0 ? `${shiftSize}px` : "";
14+
+ const appContentNavbarWrapper = document.getElementById('zen-appcontent-navbar-wrapper');
15+
+ appContentNavbarWrapper.style.paddingTop = gURLBar.textbox.hasAttribute("breakout")
16+
+ ? padding
17+
: "";
1718
if (shiftSize > 0) {
1819
// If the mouse tracking missed our fullScreenToggler, then the toolbox
19-
// might not have been shown before the menubar is animated down. Make

src/zen/compact-mode/ZenCompactMode.mjs

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,15 @@ var gZenCompactModeManager = {
709709
if (event.target.matches(':hover')) {
710710
return;
711711
}
712+
if (AppConstants.platform == 'macosx' && FullScreen._currentToolbarShift > 0) {
713+
this.flashElement(
714+
target,
715+
this.hideAfterHoverDuration,
716+
'has-hover' + target.id,
717+
'zen-has-hover'
718+
);
719+
return;
720+
}
712721

713722
if (
714723
event.explicitOriginalTarget?.closest?.('#urlbar[zen-floating-urlbar]') ||
@@ -755,12 +764,20 @@ var gZenCompactModeManager = {
755764
}
756765
window.cancelAnimationFrame(this._removeHoverFrames[target.id]);
757766

758-
this.flashElement(
759-
target,
760-
this.hideAfterHoverDuration,
761-
'has-hover' + target.id,
762-
'zen-has-hover'
763-
);
767+
if (
768+
AppConstants.platform == 'macosx' &&
769+
window.fullScreen &&
770+
entry.screenEdge === 'top'
771+
) {
772+
target.setAttribute('zen-has-hover', 'true');
773+
} else {
774+
this.flashElement(
775+
target,
776+
this.hideAfterHoverDuration,
777+
'has-hover' + target.id,
778+
'zen-has-hover'
779+
);
780+
}
764781
document.addEventListener(
765782
'mousemove',
766783
() => {

0 commit comments

Comments
 (0)