zen-browser / desktop

🌀 Experience tranquillity while browsing the web without people tracking you!
https://zen-browser.app
Mozilla Public License 2.0
19.78k stars 479 forks source link

Top bar broken in full screen (Mac) #1903

Open dude681 opened 2 months ago

dude681 commented 2 months ago

Captchas

What happened?

When in full screen mode on macos and the top bar is hidden the top bar is almost completely covered by the gray stoplight bar that appears when hovering near the top of the screen (only in full screen mode), in base firefox and other browsers the top bar moves down with the gray bar to remain fully visible.

Screenshot 2024-10-04 at 2 05 51 PM

Reproducible?

Version

1.0.1-a.7

What platform are you seeing the problem on?

macOS - aarch64

Relevant log output

No response

linear[bot] commented 2 months ago

ZEN-1867 Top bar broken in full screen (Mac)

Richard-Woessner commented 1 month ago

I'm not sure if this is a Zen issue or something with macOS, but I've noticed it happening in other apps too. When it happens, I usually just move my mouse to the top of the screen (like you would to bring up the toolbar), and that seems to make it disappear.

greeeen-dev commented 1 month ago

Looks like a Zen issue. From what I'm seeing, sidebar gets a translateY attribute assigned, but the navbar doesn't.

greeeen-dev commented 1 month ago

Yep, found the issue in src/browser/base/content/browser-fullScreenAndPointerLock.js:

...
let toolbox = gNavToolbox;
if (shiftSize > 0) {
  toolbox.style.setProperty("transform", `translateY(${shiftSize}px)`);
  toolbox.style.setProperty("z-index", "2");

  // If the mouse tracking missed our fullScreenToggler, then the toolbox
  // might not have been shown before the menubar is animated down. Make
  // sure it is shown now.
  if (!this.fullScreenToggler.hidden) {
    this.showNavToolbox();
  }
} else {
  toolbox.style.removeProperty("transform");
  toolbox.style.removeProperty("z-index");
}
...

This seems to be the code responsible for doing the translation. Here, only the sidebar gets the translation, but not the navbar. Maybe something like this could help:

...
let toolbox = gNavToolbox;
let navbar = document.getElementById('zen-appcontent-navbar-container');
if (shiftSize > 0) {
  toolbox.style.setProperty("transform", `translateY(${shiftSize}px)`);
  toolbox.style.setProperty("z-index", "2");
  navbar.style.setProperty("transform", `translateY(${shiftSize}px)`);
  navbar.style.setProperty("z-index", "2");

  // If the mouse tracking missed our fullScreenToggler, then the toolbox
  // might not have been shown before the menubar is animated down. Make
  // sure it is shown now.
  if (!this.fullScreenToggler.hidden) {
    this.showNavToolbox();
  }
} else {
  toolbox.style.removeProperty("transform");
  toolbox.style.removeProperty("z-index");
  navbar.style.removeProperty("transform");
  navbar.style.removeProperty("z-index");
}
...

Do note that I haven't tested this code, and this is just a suggestion I came up with after digging through the JS files. The team will probably have a different way in mind to implement this.

mr-cheff commented 1 month ago

browser-fullScreenAndPointerLock

this file doesnt exist

greeeen-dev commented 1 month ago

browser-fullScreenAndPointerLock

this file doesnt exist

It does exist:

image
mr-cheff commented 1 month ago

It doesn't exist on zen's source code and you mentioned src/browser/base/content/browser-fullScreenAndPointerLock.js

greeeen-dev commented 1 month ago

Thought I'd just reference the file like that so you can know where the patch file should be created. My bad for the confusion

But anyways the problematic file still seems to be browser-fullScreenAndPointerLock.js, like I said it's only translating the sidebar and not the navbar

dosubot[bot] commented 1 week ago

Hi, @dude681. I'm Dosu, and I'm helping the desktop team manage their backlog. I'm marking this issue as stale.

Issue Summary:

Next Steps:

Thank you for your understanding and contribution!

dude681 commented 1 week ago

The bug is still present and relevant

dosubot[bot] commented 1 week ago

@mauro-balades, the user @dude681 has confirmed that the bug regarding the top bar being obscured in full screen mode on macOS is still present and relevant. Could you please assist them with this issue?