Arrow panels don't have a shadow until they change size in macOS Big Sur
Categories
(Core :: Widget: Cocoa, defect, P3)
Tracking
()
People
(Reporter: lolrepeatlol, Assigned: mstange)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
|
5.12 MB,
video/quicktime
|
Details | |
|
4.73 KB,
text/plain
|
Details | |
|
47 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-beta+
|
Details | Review |
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:84.0) Gecko/20100101 Firefox/84.0
Steps to reproduce:
I clicked on a pop out.
Actual results:
The shadow did not appear.
Expected results:
The shadow should have appeared on first click. Instead, it only appeared when I clicked on something inside the pop-out that changed its size.
Tested on both Nightly 84 (2020-10-19) and Beta 82 RC.
Disclaimer: This is on a Ryzen Hackintosh which does have occasional graphics issues with its patches. (I apologize if this does not happen on normal Macs.)
Specs if it helps:
- Ryzen 7 1700
- MSI B350 PC Mate
- 16GB RAM
- Gigabyte RX 5700 XT
- OpenCore 0.6.2, macOS Big Sur Beta 10 (build 20A5395g, enrolled in Apple Public Beta Software Program), latest version of experimental AMD patches
| Reporter | ||
Updated•5 years ago
|
| Reporter | ||
Comment 1•5 years ago
|
||
I'm going to move this to Widget: Cocoa since this has been untriaged for a few days and I'm 95% sure this is what the bug would belong to.
| Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Able to reproduce on a MacBook Pro running macOS 11.0 Beta (20A5395g).
| Assignee | ||
Comment 3•5 years ago
|
||
This seems to only happen for popups that have a fade-in animation when they appear. So their first paint happens when the NSWindow's alphaValue is zero.
https://searchfox.org/mozilla-central/rev/dbced93f1c57942501c23d4633d01ce59d9087a1/widget/cocoa/nsCocoaWindow.mm#2343
| Assignee | ||
Updated•5 years ago
|
| Assignee | ||
Comment 4•5 years ago
|
||
| Assignee | ||
Comment 5•5 years ago
|
||
| Assignee | ||
Comment 6•5 years ago
|
||
I have filed FB8828157 for this.
NSWindow shadow computation incorrectly double-applies the window's alphaValue
AppKit
Incorrect/Unexpected BehaviorSteps to reproduce:
- Create an NSWindow that has a shadow and display the window.
- Set the window’s opacity to zero at runtime using -[NSWindow setAlphaValue:0].
- Set the window’s opacity to one again, using -[NSWindow setAlphaValue:1].
Expected results:
The window should retain its shadow. Invalidating the window shadow while the window has an alpha value less than 1.0 should compute the same shadow shape as when the window is fully opaque.Actual results:
Starting with Big Sur, the window’s shadow disappears as soon as the window’s alpha value reaches zero, even if the alpha is increased again afterwards. Calling -[NSWindow invalidateShadow] updates the shadow, but does not create the desired look when called if the window’s alphaValue is different from 1.0.Further details:
In Firefox, we use -[NSWindow setAlphaValue:] to implement custom fade-in animations for our custom panels. This change in Big Sur has broken those animations, and the windows end up with no shadows or with only half-transparent shadows.We can add calls to invalidateShadow, but this does not achieve the desired shadow look.
The undesirable look manifests as follows:
In the past, no shadow was visible behind opaque areas of the window, regardless of window alpha. But in Big Sur, opaque areas of a window do have a shadow visible behind them if the window’s alpha value is partially-transparent, e.g. 0.5. The opaque areas no longer “knock out” the shadow. This undesired shadow creates a darkening effect and looks especially unsightly during fade animations.I am attaching a test application to this report. It is a single file, “alpha-shadow.m”, which can be compiled and run using “clang alpha-shadow.m -framework Cocoa -o alpha-shadow && ./alpha-shadow”.
| Reporter | ||
Updated•5 years ago
|
| Assignee | ||
Comment 8•5 years ago
|
||
The fade-out animation is kept.
To work around the bug, the first paint of the panel window needs to be done at
full window opacity. Reducing the window opacity after the shadow has been
computed works correctly.
Updated•5 years ago
|
| Assignee | ||
Comment 10•5 years ago
|
||
There would have been two potential workarounds: Disabling the opening animation (which is what I ended up doing) or invalidating the window shadow whenever the window opacity changes. I decided against the latter for the following reasons:
- It would have made the animation more sluggish, because shadow computation is expensive
- The shadow would have looked wrong during the transition (too dark)
- It would have caused the fade-out animation to look worse (also too dark)
Disabling the opening animation allows us to keep the fade-out animation as-is and doesn't add overhead. We can re-enable the animation on Big Sur when Apple ships a fix.
| Assignee | ||
Comment 11•5 years ago
|
||
Comment on attachment 9189433 [details]
Bug 1672091 - Disable the fade-in animation on macOS Big Sur, to work around a macOS bug (FB8828157) that causes the panel shadow to be missing. r=dao
Beta/Release Uplift Approval Request
- User impact if declined: Odd-looking arrow panels on macOS Big sur
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: see comment 0
- List of other uplifts needed: Bug 1676434
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): small CSS fix
- String changes made/needed:
| Assignee | ||
Updated•5 years ago
|
Comment 12•5 years ago
|
||
| bugherder | ||
Updated•5 years ago
|
Comment 13•5 years ago
|
||
Reproduced the issue on Firefox 85.0a1 (20201123214551)
Verified the fix on 85.0a1 (20201124212234)
Updated•5 years ago
|
Comment 14•5 years ago
|
||
Comment on attachment 9189433 [details]
Bug 1672091 - Disable the fade-in animation on macOS Big Sur, to work around a macOS bug (FB8828157) that causes the panel shadow to be missing. r=dao
approved for 84.0b5
Updated•5 years ago
|
Comment 15•5 years ago
|
||
| bugherder uplift | ||
Comment 16•5 years ago
|
||
Verified fixed on Firefox 84.0b5 (20201126140702)
Updated•4 years ago
|
Description
•