Closed Bug 1700371 Opened 3 years ago Closed 3 years ago

Extremely low contrast on stoplight buttons when Firefox is light and system is dark

Categories

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

defect

Tracking

()

VERIFIED FIXED
89 Branch
Tracking Status
firefox89 --- verified

People

(Reporter: bugzilla, Assigned: spohl)

References

Details

(Whiteboard: [mac:darkmode])

Attachments

(3 files)

STR:

  1. Set widget.macos.respect-system-appearance to true.
  2. Set system theme to Dark.
  3. Enable a light Firefox theme, such as Light, Proton Light, or Google Chrome Light.
  4. Unfocus the Firefox window.

Actual results:
The stoplight buttons are white-on-white. Screenshot attached.

Expected: Dark grey stoplight buttons, like one sees when the system theme is Light.

I imagine this is because we're drawing the Dark mode stoplight buttons even when the Firefox theme is light.

Whiteboard: [mac:darkmode]

We can fix this by overriding the NSWindow appearance with "aqua" (light) or "dark aqua" (dark) based on the selected Firefox theme.
In order to do that, we need to communicate GetDocumentLWTheme() == Document::Doc_Theme_Bright to the nsIWidget. The code for that can be found in https://phabricator.services.mozilla.com/D104301 .

I would suggest an nsIWidget method called SetWindowAppearance(WindowAppearance aAppearance); with enum class WindowAppearance : uint8_t { eSystem, eLight, eDark }.

Assignee: nobody → spohl.mozilla.bugs
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P1
Pushed by spohl@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e70f3af0e7f2
Improve contrast of close, minimize and maximize buttons on macOS with a light Firefox theme when the system is in dark mode. r=mac-reviewers,mstange
https://hg.mozilla.org/integration/autoland/rev/840762c09a0a
Update references for Mac OS X to macOS in nsIWidget.h. r=mstange
Regressions: 1702097
Attachment #9211919 - Attachment description: Bug 1700371: Improve contrast of close, minimize and maximize buttons on macOS with a light Firefox theme when the system is in dark mode. r=#mac-reviewers → Bug 1700371: Override the NSWindow appearance based on the lightweight theme. r=mstange
Pushed by spohl@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a5f124d38938
Override the NSWindow appearance based on the lightweight theme. r=mac-reviewers,mstange
https://hg.mozilla.org/integration/autoland/rev/8599b8c86aaf
Update references for Mac OS X to macOS in nsIWidget.h. r=mstange
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
Regressions: 1704016
Flags: qe-verify+

Reproduced the initial issue using old Nightly from 2021-03-23 on macOS 11.3, verified that this is fixed using Firefox 89.0beta10 on the same configuration.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: