Re-assert True Tone after a full wake once an external is back - #144
Merged
Conversation
After a full system sleep macOS brings True Tone up while the external is still training its link, so it is computed against the built-in panel alone and the external keeps that tint until True Tone is toggled by hand (issue #131). The wake chain now does that toggle: on a didWake (never a screensDidWake, which the reporter confirmed never shows this), at the first of its passes that lists an external display, True Tone goes off and back on with a beat between, read live so it never switches on for someone who has it off. Once per wake, logged in the app category, nothing on a desk without an external.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #131. After a full system sleep macOS brings True Tone up while the external is still training its link, so the tint is computed against the built-in panel alone and the external keeps it until True Tone is toggled by hand. per-hap-s confirmed the plan and that a display sleep never shows it.
The wake chain now does that toggle.
fullWakePendingis set by didWake only, never by screensDidWake. At the first of the chain's three passes that lists an external display,CoreBrightnessService.reassertTrueTone()reads supported, available and enabled live from CBTrueToneClient (never the published value, so it cannot switch True Tone on for someone who has it off), sets it off, and sets it back on 0.3 s later so CoreBrightness does not fold the two writes into nothing. Once per wake, one log line in the app category, and a desk with no external never gets the tint blink.Not driven: a full wake with an external and True Tone on needs the lid open and a real sleep, which this session cannot do without sleeping the desk. Compiles, lints and tests green; the gate itself (didWake only, external present, True Tone on) is three guards read in the diff.