Skip to content

Commit 4832481

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

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 bef746dc594ad974c91075cf3657c199f8f8830f..bb671341b6715c42df76f7298ba55e1fac73f33b 100644
33
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
44
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
5-
@@ -424,10 +424,10 @@ var FullScreen = {
5+
@@ -423,10 +423,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
@@ -715,6 +715,15 @@ window.gZenCompactModeManager = {
715715
if (event.target.matches(':hover')) {
716716
return;
717717
}
718+
if (AppConstants.platform == 'macosx' && FullScreen._currentToolbarShift > 0) {
719+
this.flashElement(
720+
target,
721+
this.hideAfterHoverDuration,
722+
'has-hover' + target.id,
723+
'zen-has-hover'
724+
);
725+
return;
726+
}
718727

719728
if (
720729
event.explicitOriginalTarget?.closest?.('#urlbar[zen-floating-urlbar]') ||
@@ -764,12 +773,20 @@ window.gZenCompactModeManager = {
764773
}
765774
window.cancelAnimationFrame(this._removeHoverFrames[target.id]);
766775

767-
this.flashElement(
768-
target,
769-
this.hideAfterHoverDuration,
770-
'has-hover' + target.id,
771-
'zen-has-hover'
772-
);
776+
if (
777+
AppConstants.platform == 'macosx' &&
778+
window.fullScreen &&
779+
entry.screenEdge === 'top'
780+
) {
781+
target.setAttribute('zen-has-hover', 'true');
782+
} else {
783+
this.flashElement(
784+
target,
785+
this.hideAfterHoverDuration,
786+
'has-hover' + target.id,
787+
'zen-has-hover'
788+
);
789+
}
773790
document.addEventListener(
774791
'mousemove',
775792
() => {

0 commit comments

Comments
 (0)