Closed Bug 1715145 Opened 3 years ago Closed 3 years ago

Make dark theme affect all windows, if widget.macos.respect-system-appearance is true

Categories

(Core :: Widget: Cocoa, task)

All
macOS
task

Tracking

()

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(2 files)

Let's remove support for per-window light/dark mode, and instead make it a Firefox-wide setting which affects all windows.
At the moment, if the Firefox theme is Dark but the macOS theme is Light, then browser windows follow the Firefox theme and other windows (Download dialog, Page Info window, Library window) follow the system theme. It is much easier to make all windows follow the Firefox theme. If the user wants to use the macOS theme, they can select the Firefox "System" theme, and all Firefox windows will match the macOS theme.

Background:
Many of the remaining bugs for full dark mode support (bug 1623686) only occur when the Firefox theme differs from the macOS theme, i.e. light/dark or dark/light: bug 1703980, bug 1705821, bug 1710122, bug 1710164. The challenge in those bugs is inheriting the right theme down into sub-windows, e.g. sheet windows or popups/panels. But if there is only one global theme, then we don't need to do any inheriting.

This will change the meaning of the widget.macos.respect-system-appearance pref: The system appearance will only respected if the Firefox System theme is selected. The pref will then only affect what happens when Firefox is in the Dark theme: If the pref is off, CSS colors and -moz-default-appearance drawing will be light, and if the pref is on, CSS colors and -moz-default-appearance will be dark. So then it would make sense to rename the pref. A very truthful pref name would be widget.macos.support-dark-appearance-for-system-colors-and-native-theme-drawing but that's quite a mouthful.

Blocks: 1710122

This patch also removes the pref widget.system-colors-follow-theme, which was
only true on macOS. System colors now follow the global Firefox theme.

Pushed by mstange@themasta.com:
https://hg.mozilla.org/integration/autoland/rev/cc07129dbc8e
Rename widget.macos.respect-system-appearance to widget.macos.support-dark-appearance, and make the Firefox theme affect all windows if the pref is true. r=emilio
https://hg.mozilla.org/integration/autoland/rev/259f602b8949
Remove now-unnecessary per-window appearance override. This reverts bug 1700371. r=emilio
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
No longer blocks: 1710164

Is this something we should consider for Beta backport?

Flags: needinfo?(mstange.moz)

(In reply to Ryan VanderMeulen [:RyanVM] from comment #5)

Is this something we should consider for Beta backport?

It doesn't have any effect unless the pref is set, and the pref still defaults to false. We've only started enabling the pref in 91 Nightly + Early Beta, in bug 1715619. And the pref flip isn't something we want to uplift, so this isn't needed either.

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: