Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically enable AdjustIndistinguishableColors if High Contrast mode enabled #17346

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

carlos-zamora
Copy link
Member

@carlos-zamora carlos-zamora commented May 31, 2024

Summary of the Pull Request

If High Contrast mode is enabled in the OS settings, we now automatically enable adjustIndistinguishableColors. To accomplish this, a new Automatic value is added to adjustIndistinguishableColors. When it's chosen, color nudging doesn't occur in regular contrast sessions, but we interpret the value as Indexed respectively.

The new default value is AutomaticIndexed. Meaning that regular contrast sessions will see no difference in behavior. However, if they switch to high contrast mode, Windows Terminal will interpret the value as Indexed at runtime. This was chosen because Always is more performance intensive.
  

References and Relevant Issues

#12999

Validation Steps Performed

✅ Toggling High Contrast mode immediately triggers an updated terminal instance with adjustIndistinguishableColors

@carlos-zamora
Copy link
Member Author

For the record, AcessibilitySettings didn't work. Wasn't able to get the correct HighContrast value or be notified via HighContrastChanged. So I had to go the WM_SETTINGCHANGE route

https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.accessibilitysettings?view=winrt-22621

This comment has been minimized.

@carlos-zamora

This comment was marked as resolved.

@lhecker
Copy link
Member

lhecker commented May 31, 2024

1>D:\projects\terminal\src\renderer\atlas\AtlasEngine.r.cpp(493,19): error C2653: 'Feature_AtlasEnginePresentFallback': is not a class or namespace name

Hmm that's odd. Your PR doesn't touch anything like that. You may have to just do a good 'ol git clean -xfd and recompile from scratch, or maybe it's already sufficient to just build-clean the entire solution.

@DHowett
Copy link
Member

DHowett commented Jun 5, 2024

I think @PankajBhojwani has some research on this with JTippet

@PankajBhojwani
Copy link
Contributor

I wonder if we also want to increase the delta e threshold we use when we detect high contrast mode! That was what we discussed with Jeffrey Tippet (3 years ago at this point wow), his response was along the lines of "that makes sense, though know that this isn't the way win32 apps work". I think how color nudging should work with HC is something that likely needs more discussion/potentially a spec, but automatically turning on the feature when in HC mode makes sense as a start.

@carlos-zamora
Copy link
Member Author

Ah, sounds like you're talking about this. 😏

@carlos-zamora carlos-zamora marked this pull request as ready for review October 31, 2024 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants