Closed Bug 1737831 Opened 3 years ago Closed 2 years ago

Unnecessary space when sliding menubar down in fullscreen on new Macbook Pros with notch

Categories

(Core :: Widget: Cocoa, defect, P2)

Firefox 93
defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: joao.sarmento, Assigned: emilio)

References

Details

Attachments

(4 files)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:93.0) Gecko/20100101 Firefox/93.0

Steps to reproduce:

  1. Using new Macbook Pro 14'', updated Monterey on 12.0.1
  2. Set firefox as full screen, menubar is hidden
  3. Hovering to menubar theres a huge blank gap between resize icons and tabs, instead of side-by-side

Actual results:

theres a huge blank gap between resize icons and tabs, instead of side-by-side

Expected results:

the gap shouldn't be there

Hi,

I have tested your issue on latest FF release 93, Beta 94 and latest Nightly build 95.0a1 and could not reproduce it using macOS Monterey version 12.0.1 on MacBook Pro (13-inch 2017).
If the issue is still reproducible on your end, can you please retest this using latest Nightly build (https://nightly.mozilla.org/) and report back the results? When doing this, please use a new clean Firefox profile (https://goo.gl/AWo6h8) to eliminate the potential causes.

Thanks for the report.

Flags: needinfo?(joao.sarmento)

(In reply to Alin Ilea from comment #1)

Hi,

I have tested your issue on latest FF release 93, Beta 94 and latest Nightly build 95.0a1 and could not reproduce it using macOS Monterey version 12.0.1 on MacBook Pro (13-inch 2017).
If the issue is still reproducible on your end, can you please retest this using latest Nightly build (https://nightly.mozilla.org/) and report back the results? When doing this, please use a new clean Firefox profile (https://goo.gl/AWo6h8) to eliminate the potential causes.

Thanks for the report.

Hello,

As provided on the ticket summary and description, this is for Macbook Pro 14'' and i'm assuming on Macbook Pro 16'' as well. Most likely due to notch behavior. So it's not happening on 13 inches versions.

Thanks

Flags: needinfo?(joao.sarmento)

We also tried to reproduce it on macbook pro 16" but with macOS Big Sur version 11.6, without success. Unfortunately we don't have Macbook Pro 14'' or Macbook Pro 16'' with macOS 12 Monterey in order to test it using an more appropriate environment.
What I can do for now is to assign a component for this ticket and maybe the developers can help more.
Thanks for the collaboration.

Component: Untriaged → Widget: Cocoa
Product: Firefox → Core

Later today I'll try to make a screenrecording reproducing this issue and upload in this ticket

Best,

This requires a new Macbook Pro with a notch at the top of the screen.

Native full screen mode behaves differently on those machines.
On machines without a notch, the window covers the entire screen, and moving the mouse to the top of the screen slides down a menubar over the window.
On machines with a notch, the window does not cover the entire screen: there is a reserved black area at the top. Moving the mouse to the top of the screen reveals the menubar which appears in the reserved black areas, with no slide-over.

Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Firefox Macbook Pro 14 Fullscreen → Unnecessary space when sliding menubar down in fullscreen on new Macbook Pros with notch

I am also seeing this behavior (MacBook Pro 14" 8C M1 Pro) and can confirm it's happening in the newest nightly (96.0a1) as well.

Attached video screen capture

Here's a video of the bug

The severity field is not set for this bug.
:spohl, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(spohl.mozilla.bugs)
Severity: -- → S2
Flags: needinfo?(spohl.mozilla.bugs)
Priority: -- → P2

I think the issue is at widget/cocoa/nsCocoaWindow.mm:3712:

CGFloat shiftByPixels = (mInitialTitlebarHeight + mMenuBarHeight) * aShownAmount;

This always shifts by the menu bar height, but with a notch it's not necessary since the menu bar will be shown in the notch area.

A very crude first attempt to fix it:

NSScreen* targetScreen = [NSScreen mainScreen];
CGFloat shiftByPixels;
if (@available(macOS 12.0, *) && (targetScreen.safeAreaInsets.top != 0)) {
    shiftByPixels = mInitialTitlebarHeight * aShownAmount;
} else {
    shiftByPixels = (mInitialTitlebarHeight + mMenuBarHeight) * aShownAmount;
}

This issue is also happening on 2021 Macbook Pro 16" when using the nest nightly build Version 96.0a1

This can actually be reproduced without a notch. On macOS 12, open System Preferences > Dock & Menu Bar, and uncheck the setting "Automatically hide and show the menu bar in full screen." I have this same issue on a 2018 MBP.

Not sure if there's a better way to do this, but this works on a 2018 mbp with
the "Automatically show and hide the menubar on full screen" setting on and
off.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

If someone with an M1 mac can test a build from https://treeherder.mozilla.org/#/jobs?repo=try&revision=010c9cd8d3c67e5242506244a207239a0b303e69 it'd be great :-)

I'm happy to, where can I find the executable?

https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/X9gR9UA5Qy61ugQ9yFSXyw/runs/0/artifacts/public/build/target.dmg is a link to the DMG (if you click on the "B", there's an "Artifacts and debugging tools" tab, which has a link to all build artifacts, I just copied it from there for convenience).

If it doesn't work on the M1 mac, we may need a separate check for safe area insets similar to the one suggested by comment 11.

(In reply to João from comment #19)

Not working

Alright, not totally unexpected, patch for that case above. Can you try a build from https://treeherder.mozilla.org/#/jobs?repo=try&revision=f919b4e929718b025830f959292253a7204acc76 when it's available?

I only see log files under Artifacts and Debugging tools.

Could you please provide the link to dmg? Sorry for the inconvenience

The build from #21 failed. Maybe the build system is using a too old MacOS SDK?

According to Apple's documentation safeAreaInsets property on NSScreen was introduced in Xcode 13. From the build logs I think the build system is using the SDK from Xcode 12.

Ah, too bad, it built locally of course... I'm out for the day, will try to fix it up tomorrow.

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #26)

Tested the build on a MacBook pro 16" with notch: with the new build the issue is fixed.

Yay, thanks for testing it!

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/63c7b0bf7506
Detect whether menu bar is visible at the beginning of fullscreen, and if so don't shift down by menubar height. r=mac-reviewers,mstange
Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/268cb02289ce
Also detect when the screen has a notch and, if so, don't shift by the menubar height either. r=mac-reviewers,mstange
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

Was able to reproduce the issue on Firefox 95.0a1 (2021-10-26) under macOS 12.0.1 on a macbook pro mid 2015 by deactivating the pref mentioned in Comment 14.

The issue is fixed on Firefox 97.0a1 (2022-01-04) on the same system. Will verify on macbook with notch too, soon.

Regressions: 1749589

How do we feel about backing this out for now and testing a new fix across hardware/OS versions? Covering tab bars seems worse than displaying an extra gap in fullscreen for MacBooks with a notch. We also have more people with MacBooks with a notch now that could help implement/test a fix.

Flags: needinfo?(htwyford)
Flags: needinfo?(emilio)

(In reply to Stephen A Pohl [:spohl] from comment #34)

How do we feel about backing this out for now and testing a new fix across hardware/OS versions? Covering tab bars seems worse than displaying an extra gap in fullscreen for MacBooks with a notch.

In my case the extra space is a constant issue which is fixed in 97.0a1, whereas I cannot reproduce the covering tab bars issue unless I activate the "Scale to fit below built-in camera" option, which is an option not normally active. Basically in my case I would much rather have the fix, but I understand other users with different configurations might be in a different situation.

Until a better fix is implemented, instead of completely reverting the fix would having the fix available through an about:config preference be an option?

Yeah, let me put this behind some sort of pref. But we should probably back out from 97, or uplift the pref + fix. On it.

Flags: needinfo?(htwyford)
Flags: needinfo?(emilio)
Flags: qe-verify+

Verification was performed on bug 1748640. Removing qe+.

Flags: qe-verify+
See Also: → 1815099
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: