Closed Bug 1702097 Opened 3 years ago Closed 3 years ago

Inconsistent native button drawing in windows with overridden appearance

Categories

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

All
macOS
defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox87 --- unaffected
firefox88 --- unaffected
firefox89 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [mac:darkmode][mac:mr1])

Attachments

(1 file)

Steps to reproduce:

  1. In a build with the patch for bug 1700371, go to toolbar customization.
  2. In the macOS system accessibility Display preferences, enable Increase contrast.
  3. In the macOS system general preferences, set the system to Light Mode.
  4. In Firefox in toolbar customization, using the Themes dropdown at the bottom, switch to the dark Firefox theme.
  5. Notice how the buttons in the bottom right corner are drawn transparently.
  6. Move your mouse over those buttons.

Expected results:
The buttons should pick one look and stick with it.

Actual results:
The buttons redraw with an opaque white background once hovered.

The bug here is that they draw transparently at all - if the system is set to Light Mode, or if widget.macos.respect-system-appearance is false, they should always be drawn with the Aqua appearance, which has an opaque white background.
It looks like they only draw transparently because they draw just after the window background itself is drawn. When the window background is drawn, since the window is set to the dark appearance, the global NSAppearance.currentAppearance is set to dark, and our native theme drawing seems to be affected by NSAppearance.currentAppearance.

This is global state, so it can have remnants from random other state changes.
Starting with Big Sur, currentAppearance is deprecated in favor of
performAsCurrentDrawingAppearance, which really does seem like a better API for
this.

Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/1a95326e8e60
Reset NSAppearance.currentAppearance before native theme drawing. r=spohl
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Flags: qe-verify+

I can't seem to be able to reproduce this issue on my macOS 10.15. Can you please verifiy if the issue is reproducing latest Beta 89.0b.
Thank you.

Flags: needinfo?(mstange.moz)
Has Regression Range: --- → yes
Flags: needinfo?(mstange.moz)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: