Skip to content

Commit 180e8b8

Browse files
committed
fix: Shift navbar down when accesing it on macOS in fullscreen (#8757)
1 parent 2d54e9f commit 180e8b8

File tree

3 files changed

+32
-15
lines changed

3 files changed

+32
-15
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 c61a424d3871d94e7086418c72ce22d5aef0a047..b6e3939b1ce67185acc3b9a66385869bd5490a39 100644
33
--- a/browser/base/content/browser-fullScreenAndPointerLock.js
44
+++ b/browser/base/content/browser-fullScreenAndPointerLock.js
5-
@@ -431,10 +431,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
@@ -578,6 +578,15 @@ var gZenCompactModeManager = {
578578
if (event.target.matches(':hover')) {
579579
return;
580580
}
581+
if (AppConstants.platform == 'macosx' && FullScreen._currentToolbarShift > 0) {
582+
this.flashElement(
583+
target,
584+
this.hideAfterHoverDuration,
585+
'has-hover' + target.id,
586+
'zen-has-hover'
587+
);
588+
return;
589+
}
581590

582591
if (
583592
event.explicitOriginalTarget.closest('#urlbar[zen-floating-urlbar]') ||
@@ -624,12 +633,20 @@ var gZenCompactModeManager = {
624633
}
625634
window.cancelAnimationFrame(this._removeHoverFrames[target.id]);
626635

627-
this.flashElement(
628-
target,
629-
this.hideAfterHoverDuration,
630-
'has-hover' + target.id,
631-
'zen-has-hover'
632-
);
636+
if (
637+
AppConstants.platform == 'macosx' &&
638+
window.fullScreen &&
639+
entry.screenEdge === 'top'
640+
) {
641+
target.setAttribute('zen-has-hover', 'true');
642+
} else {
643+
this.flashElement(
644+
target,
645+
this.hideAfterHoverDuration,
646+
'has-hover' + target.id,
647+
'zen-has-hover'
648+
);
649+
}
633650
document.addEventListener(
634651
'mousemove',
635652
() => {

src/zen/compact-mode/zen-compact-mode.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339
top: calc(-1 * var(--zen-toolbar-height) + 1px);
340340
left: 0;
341341
z-index: 20;
342-
transition: all 0.15s ease;
342+
transition: all 0.15s ease, padding 0s;
343343
width: 100%;
344344

345345
max-height: var(--zen-toolbar-height);

0 commit comments

Comments
 (0)