UI is broken in system high contrast mode #7416

Closed
opened 2026-01-31 01:03:26 +00:00 by claunia · 20 comments
Owner

Originally created by @mimi89999 on GitHub (Apr 15, 2020).

Environment

Windows build number: 10.0.19603.1000
Windows Terminal version (if applicable): 0.10.781.0

Steps to reproduce

Turn on high contrast mode.

Expected behavior

UI elements should become easier to distinguish.

Actual behavior

Terminal UI elements are hard to identify. It took me some time to find the + button because it looks like the Windows logo or the start menu button and not like a +. Dropdown button looks more like a checkbox than a dropdown button or arrow pointing down.

Screenshot_win10_2020-04-15_17:10:46

Originally created by @mimi89999 on GitHub (Apr 15, 2020). # Environment ``` Windows build number: 10.0.19603.1000 Windows Terminal version (if applicable): 0.10.781.0 ``` # Steps to reproduce Turn on high contrast mode. # Expected behavior UI elements should become easier to distinguish. # Actual behavior Terminal UI elements are hard to identify. It took me some time to find the `+` button because it looks like the Windows logo or the start menu button and not like a `+`. Dropdown button looks more like a checkbox than a dropdown button or arrow pointing down. ![Screenshot_win10_2020-04-15_17:10:46](https://user-images.githubusercontent.com/8530546/79354050-2d1f1b00-7f3c-11ea-9e10-b0baa188a563.png)
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2020):

Okay yea this is pretty bad. I would have thought that this might have to be fixed on the upstream TabView. However, looking at MUX#1663, that high-contrast tabview looks just fine.

@zadjii-msft commented on GitHub (Apr 15, 2020): Okay yea this is pretty bad. I would have thought that this might have to be fixed on the upstream TabView. However, looking at [MUX#1663](https://github.com/microsoft/microsoft-ui-xaml/pull/1663), that high-contrast tabview looks just fine.
Author
Owner

@zadjii-msft commented on GitHub (Apr 15, 2020):

Wait now I'm reading that thread more, we might be able to get this by just updating to the latest MUX.

This comment: https://github.com/microsoft/microsoft-ui-xaml/pull/1663#issuecomment-557915281 made me think that they might have just solved this for us 😆

@zadjii-msft commented on GitHub (Apr 15, 2020): Wait now I'm reading that thread more, we might be able to get this by just updating to the latest MUX. This comment: https://github.com/microsoft/microsoft-ui-xaml/pull/1663#issuecomment-557915281 made me think that they might have just solved this for us 😆
Author
Owner

@jtippet commented on GitHub (Apr 15, 2020):

@zadjii-msft - I just stopped by the Terminal github project to send you guys an email to ask you to update to the latest MUX, so I can start contributing some PRs to smooth out Terminal's HC experience. I promise mimi8999 is not in cahoots with me, and this issue getting filed today is a total coincidence ;)

XAML has a global "I understand high contrast" flag named ApplicationHighContrastAdjustment. For Terminal, it's currently in HC-ignorant mode, which means MUX is more aggressive about ignoring your colors and automatically backplating text. This is not wrong, but it will make it difficult to reach perfect beauty. Beyond updating MUX, the next best thing you can do is toggle that flag, then fix the issues that it was hiding (invisible dialog box buttons, menu text, wrong titlebar color, etc.)

I'm happy to contribute wherever you can use help -- the whole reason I fixed MUX's TabView was so I could subsequently make my terminals not ugly.

@jtippet commented on GitHub (Apr 15, 2020): @zadjii-msft - I just stopped by the Terminal github project to send you guys an email to ask you to update to the latest MUX, so I can start contributing some PRs to smooth out Terminal's HC experience. I promise mimi8999 is not in cahoots with me, and this issue getting filed today is a total coincidence ;) XAML has a global "I understand high contrast" flag named ApplicationHighContrastAdjustment. For Terminal, it's currently in HC-ignorant mode, which means MUX is more aggressive about ignoring your colors and automatically backplating text. This is not wrong, but it will make it difficult to reach perfect beauty. Beyond updating MUX, the next best thing you can do is toggle that flag, then fix the issues that it was hiding (invisible dialog box buttons, menu text, wrong titlebar color, etc.) I'm happy to contribute wherever you can use help -- the whole reason I fixed MUX's TabView was so I could subsequently make my terminals not ugly.
Author
Owner

@mimi89999 commented on GitHub (Apr 15, 2020):

@jtippet Were you able to build Terminal with latest MUX release? I wasn't.

@mimi89999 commented on GitHub (Apr 15, 2020): @jtippet Were you able to build Terminal with latest MUX release? I wasn't.
Author
Owner

@jtippet commented on GitHub (Apr 15, 2020):

I didn't attempt that. I've only prototyped the other half - cleaning up button labels and menu text.

@jtippet commented on GitHub (Apr 15, 2020): I didn't attempt that. I've only prototyped the other half - cleaning up button labels and menu text.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 17, 2020):

Triaging this for 1.x. If WinUI 2.4 lands before that, we may get it as part of a dependency updating pass.

@DHowett-MSFT commented on GitHub (Apr 17, 2020): Triaging this for 1.x. If WinUI 2.4 lands before that, we may get it as part of a dependency updating pass.
Author
Owner

@WSLUser commented on GitHub (Apr 21, 2020):

Since I was looking into bumping deps, I did try updating to the preview release (we are actually on a 2.2. preview so going to 2.4 preview seems acceptable) but ran into problems attempting to build. I can update the other stuff but while debug mode is fine, the release mode has an issue compiling conpty in preview mode of VS 2019 and a problem finding the generated .lib in stable. Not sure what exactly is at play but my fork is available to test with. Also, you need to statically assign paths for instead of using wildcards in the build process. VS2019 won't accept the wildcards (building Terminal becomes even worse without letting VS statically assign the build paths).

@WSLUser commented on GitHub (Apr 21, 2020): Since I was looking into bumping deps, I did try updating to the preview release (we are actually on a 2.2. preview so going to 2.4 preview seems acceptable) but ran into problems attempting to build. I can update the other stuff but while debug mode is fine, the release mode has an issue compiling conpty in preview mode of VS 2019 and a problem finding the generated .lib in stable. Not sure what exactly is at play but my fork is available to test with. Also, you need to statically assign paths for instead of using wildcards in the build process. VS2019 won't accept the wildcards (building Terminal becomes even worse without letting VS statically assign the build paths).
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 21, 2020):

Thanks for looking into this! I’m a bit concerned. We are using 2.3, for what it’s worth, and even though it says “prerelease” it’s definitely the full retail payload. There’s a depressing reason for that... but in short, the “prerelease” builds put their DLLs inside our package, and the retail ones do not, and we need that copy of their DLL.

Which version of VS2019 are you seeing this with? The team has been building on 2019 since it came out, and hasn’t seen any trouble with the wildcards.

@DHowett-MSFT commented on GitHub (Apr 21, 2020): Thanks for looking into this! I’m a bit concerned. We are using 2.3, for what it’s worth, and even though it says “prerelease” it’s definitely the full retail payload. There’s a depressing reason for that... but in short, the “prerelease” builds put their DLLs inside our package, and the retail ones do not, and we _need_ that copy of their DLL. Which version of VS2019 are you seeing this with? The team has been building on 2019 since it came out, and hasn’t seen any trouble with the wildcards.
Author
Owner

@DHowett-MSFT commented on GitHub (Apr 21, 2020):

Thanks for looking into this! I’m a bit concerned. We are using 2.3, for what it’s worth, and even though it says “prerelease” it’s definitely the full retail payload. There’s a depressing reason for that... but in short, the “prerelease” builds put their DLLs inside our package, and the retail ones do not, and we need that copy of their DLL.

Which version of VS2019 are you seeing this with? The team has been building on 2019 since it came out, and hasn’t seen any trouble with the wildcards.

@DHowett-MSFT commented on GitHub (Apr 21, 2020): Thanks for looking into this! I’m a bit concerned. We are using 2.3, for what it’s worth, and even though it says “prerelease” it’s definitely the full retail payload. There’s a depressing reason for that... but in short, the “prerelease” builds put their DLLs inside our package, and the retail ones do not, and we _need_ that copy of their DLL. Which version of VS2019 are you seeing this with? The team has been building on 2019 since it came out, and hasn’t seen any trouble with the wildcards.
Author
Owner

@jtippet commented on GitHub (Jul 7, 2020):

@DHowett-MSFT - may I request updating MUX again to 2.5.0-prerelease.200609001? That version contains a couple important fixes to unblock a fix for this issue:

With that version of MUX, Terminal is very close to being beautiful in all HC themes. Here's a peek at what it looks like with the newer MUX and a change to set Terminal to ApplicationHighContrastAdjustment::None:
image

Compare that to the screenshot at the top of this thread, and I think it's clearly an improvement. The menu is rather less embarrassing too:

Current 2.5.0 + AHCA::None
image image

As a bonus, by updating to 2.5.0, you'll also get rounded tab feet, which is catnip for tab nerds:
image

@jtippet commented on GitHub (Jul 7, 2020): @DHowett-MSFT - may I request updating MUX again to 2.5.0-prerelease.200609001? That version contains a couple important fixes to unblock a fix for this issue: * https://github.com/microsoft/microsoft-ui-xaml/pull/2446 * https://github.com/microsoft/microsoft-ui-xaml/pull/2377 With that version of MUX, Terminal is very close to being beautiful in all HC themes. Here's a peek at what it looks like with the newer MUX and a change to set Terminal to `ApplicationHighContrastAdjustment::None`: ![image](https://user-images.githubusercontent.com/10259764/86704670-fa7c4000-bfc9-11ea-9a4c-8ee167568ecf.png) Compare that to the screenshot at the top of this thread, and I think it's clearly an improvement. The menu is rather less embarrassing too: | Current | 2.5.0 + `AHCA::None` | | --- | --- | | ![image](https://user-images.githubusercontent.com/10259764/86705949-3cf24c80-bfcb-11ea-99f4-2ba38d6778d3.png) | ![image](https://user-images.githubusercontent.com/10259764/86705963-411e6a00-bfcb-11ea-85f6-0e3786fecc07.png) | As a bonus, by updating to 2.5.0, you'll also get rounded tab feet, which is catnip for tab nerds: ![image](https://user-images.githubusercontent.com/10259764/86704754-0e27a680-bfca-11ea-82c6-e73e4be6c5d9.png)
Author
Owner

@mimi89999 commented on GitHub (Jul 7, 2020):

Is there any progress on this issue? The latest preview from the Store still looks really bad

Screenshot_win10_2020-07-07_11:53:22

@mimi89999 commented on GitHub (Jul 7, 2020): Is there any progress on this issue? The latest preview from the Store still looks really bad ![Screenshot_win10_2020-07-07_11:53:22](https://user-images.githubusercontent.com/8530546/86764928-c85df300-c048-11ea-8bba-86e2d77b4eae.png)
Author
Owner

@mimi89999 commented on GitHub (Jul 7, 2020):

Also, I noticed that some icons in the taskbar change to monochrome and others don't. Why?

@mimi89999 commented on GitHub (Jul 7, 2020): Also, I noticed that some icons in the taskbar change to monochrome and others don't. Why?
Author
Owner

@zadjii-msft commented on GitHub (Jul 7, 2020):

@jtippet absolutely lets update! Kinda funny that we only just got on 2.4 (#5778) a few days before the 2.5 prerelease came out 😃

@zadjii-msft commented on GitHub (Jul 7, 2020): @jtippet absolutely lets update! Kinda funny that we only just got on 2.4 (#5778) a few days before the 2.5 prerelease came out 😃
Author
Owner

@jtippet commented on GitHub (Jul 7, 2020):

Is there any progress on this issue? The latest preview from the Store still looks really bad

There's definitely been progress -- comparing your original screenshot with your current one, you can see that the tab titles look better. That's fix 1663 in MUX, which already shipped in the store version of Terminal. The menu will be improved a bit once #6819 lands, and then there's really only one more line of code to add to Terminal to make everything look like the screenshot I shared.

Also, I noticed that some icons in the taskbar change to monochrome and others don't. Why?

The OS never automatically generates monochrome icons from a full-color icon. It would rarely look great, and in some cases, would make an unreadable mess.

For the app launcher icons in the center of the taskbar, the shell relies on the app to provide a hand-crafted high contrast icon. But only UWP has the technology to designate an icon as being for high contrast -- classic win32 resources don't even have the concept. (Classic win32 can only tailor icons for display scale and color bitdepth, the latter of which is entirely obsolete, since nobody's rocking an EGA display anymore.) So a UWP app can display colorful icons when HC is disabled, while automatically switching to monochrome icons when HC is enabled. But a Win32 app has to choose one or the other, and can't adapt to the HC setting. That's why, in your screenshot, the File Explorer icon is not monochrome: File Explorer is a win32 app.

Furthermore, an app will only change its icon if the app developer's art department actually troubled themselves to provide a high contrast version of the icon. That's why, in your screenshot, Terminal does not have a monochrome icon: the Terminal art department did not provide one. Although if you have more pixel talents than I, perhaps the Terminal team would accept a contribution of beautiful new HC icons? See here.

Hopefully, as Project Reunion makes UWP technology more readily available, more developers will include high contrast icons with their apps.

@jtippet commented on GitHub (Jul 7, 2020): > Is there any progress on this issue? The latest preview from the Store still looks really bad There's definitely been progress -- comparing your original screenshot with your current one, you can see that the tab titles look better. That's fix 1663 in MUX, which already shipped in the store version of Terminal. The menu will be improved a bit once #6819 lands, and then there's really only one more line of code to add to Terminal to make everything look like the screenshot I shared. > Also, I noticed that some icons in the taskbar change to monochrome and others don't. Why? The OS never automatically generates monochrome icons from a full-color icon. It would rarely look great, and in some cases, would make an unreadable mess. For the app launcher icons in the center of the taskbar, the shell relies on the app to provide a hand-crafted high contrast icon. But only UWP has [the technology](https://docs.microsoft.com/en-us/windows/uwp/app-resources/tailor-resources-lang-scale-contrast) to designate an icon as being for high contrast -- classic win32 resources don't even have the concept. (Classic win32 can *only* tailor icons for display scale and color bitdepth, the latter of which is entirely obsolete, since nobody's rocking an EGA display anymore.) So a UWP app can display colorful icons when HC is disabled, while automatically switching to monochrome icons when HC is enabled. But a Win32 app has to choose one or the other, and can't adapt to the HC setting. That's why, in your screenshot, the File Explorer icon is not monochrome: File Explorer is a win32 app. Furthermore, an app will only change its icon if the app developer's art department actually troubled themselves to provide a high contrast version of the icon. That's why, in your screenshot, Terminal does not have a monochrome icon: the Terminal art department did not provide one. Although if you have more pixel talents than I, perhaps the Terminal team would accept a contribution of beautiful new HC icons? See [here](https://github.com/microsoft/terminal/tree/master/res/terminal/images). Hopefully, as Project Reunion makes UWP technology [more readily available](https://docs.microsoft.com/en-us/windows/uwp/app-resources/using-mrt-for-converted-desktop-apps-and-games), more developers will include high contrast icons with their apps.
Author
Owner

@mimi89999 commented on GitHub (Jul 7, 2020):

There's definitely been progress -- comparing your original screenshot with your current one, you can see that the tab titles look better. That's fix 1663 in MUX, which already shipped in the store version of Terminal. The menu will be improved a bit once #6819 lands, and then there's really only one more line of code to add to Terminal to make everything look like the screenshot I shared.

Ah. OK. I see that the tabs look good now, but the + and arrow down buttons still have a background. I thought that they also would be fixed since in the animation in https://github.com/microsoft/microsoft-ui-xaml/pull/1663#issuecomment-557915281 those buttons also don't have the background anymore.

For the app launcher icons in the center of the taskbar, the shell relies on the app to provide a hand-crafted high contrast icon. But only UWP has the technology to designate an icon as being for high contrast...

Thanks for this long explanation. Hopefully Terminal will get a monochrome icon soon 😉
As for old Win32 apps, I saw that MS made a nonofficial API for dark theme especially for Explorer. AFAIK only Explorer and Recorder are using it. Somebody managed to enable it: https://github.com/ysc3839/win32-darkmode. Maybe they will do the same for icons? I don't see them anywhere close to rewriting old Win32 apps. Anyway, that's off topic here...

@mimi89999 commented on GitHub (Jul 7, 2020): > There's definitely been progress -- comparing your original screenshot with your current one, you can see that the tab titles look better. That's fix 1663 in MUX, which already shipped in the store version of Terminal. The menu will be improved a bit once #6819 lands, and then there's really only one more line of code to add to Terminal to make everything look like the screenshot I shared. Ah. OK. I see that the tabs look good now, but the `+` and arrow down buttons still have a background. I thought that they also would be fixed since in the animation in https://github.com/microsoft/microsoft-ui-xaml/pull/1663#issuecomment-557915281 those buttons also don't have the background anymore. > For the app launcher icons in the center of the taskbar, the shell relies on the app to provide a hand-crafted high contrast icon. But only UWP has the technology to designate an icon as being for high contrast... Thanks for this long explanation. Hopefully Terminal will get a monochrome icon soon :wink: As for old Win32 apps, I saw that MS made a nonofficial API for dark theme especially for Explorer. AFAIK only Explorer and Recorder are using it. Somebody managed to enable it: https://github.com/ysc3839/win32-darkmode. Maybe they will do the same for icons? I don't see them anywhere close to rewriting old Win32 apps. Anyway, that's off topic here...
Author
Owner

@jtippet commented on GitHub (Jul 7, 2020):

I thought that they also would be fixed since in the animation in microsoft/microsoft-ui-xaml#1663 (comment) those buttons also don't have the background anymore.

Yeah, I fixed the standard TabView [+] icon that ships with MUX. But Terminal doesn't use the standard icon. It builds its own from scratch, so it can have the dropdown menu. Don't worry though: I'm fixing Terminal's [+] button too: #6812

As for old Win32 apps, I saw that MS made a nonofficial API for dark theme especially for Explorer.

You can definitely write code to detect whether HC is enabled, and if so, query the background color. You don't even need undocumented APIs -- just query SPI_GETHIGHCONTRAST. So you can already write a win32 app that draws a beautiful icon in all modes. But the taskbar problem that you're seeing is different: the app isn't drawing the icons, so there's no amount of code you can add to the app to fix the problem. There are various OS surfaces (taskbar, start menu, alt+tab, task manager, ...) where the OS draws an icon on behalf of your app. In those cases, the OS needs to know which of your icons to use. UWP has a sophisticated metadata system, so for example you can describe an icon as being designed for 200% DPI + high contrast black theme + fr_CA locale. The OS will inventory all your icons, sift through the metadata, then select the best icon for the current situation. Compare that to Win32, where the icon can only talk about pixels and color depth -- there's simply no way for you to say that a particular icon is designed to look great in HC black theme.

@jtippet commented on GitHub (Jul 7, 2020): > I thought that they also would be fixed since in the animation in microsoft/microsoft-ui-xaml#1663 (comment) those buttons also don't have the background anymore. Yeah, I fixed the standard TabView [+] icon that ships with MUX. But Terminal doesn't use the standard icon. It builds its own from scratch, so it can have the dropdown menu. Don't worry though: I'm fixing Terminal's [+] button too: #6812 > As for old Win32 apps, I saw that MS made a nonofficial API for dark theme especially for Explorer. You can definitely write code to detect whether HC is enabled, and if so, query the background color. You don't even need undocumented APIs -- just query `SPI_GETHIGHCONTRAST`. So you can already write a win32 app that draws a beautiful icon in all modes. But the taskbar problem that you're seeing is different: the app isn't drawing the icons, so there's no amount of code you can add to the app to fix the problem. There are various OS surfaces (taskbar, start menu, alt+tab, task manager, ...) where the OS draws an icon _on behalf of_ your app. In those cases, the OS needs to know which of your icons to use. UWP has a sophisticated metadata system, so for example you can describe an icon as being designed for 200% DPI + high contrast black theme + fr_CA locale. The OS will inventory all your icons, sift through the metadata, then select the best icon for the current situation. Compare that to Win32, where the icon can only talk about pixels and color depth -- there's simply no way for you to say that a particular icon is designed to look great in HC black theme.
Author
Owner

@ghost commented on GitHub (Jul 21, 2020):

:tada:This issue was addressed in #6915, which has now been successfully released as Windows Terminal v1.1.2021.0.🎉

Handy links:

@ghost commented on GitHub (Jul 21, 2020): :tada:This issue was addressed in #6915, which has now been successfully released as `Windows Terminal v1.1.2021.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.2021.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6915, which has now been successfully released as Windows Terminal v1.1.2021.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6915, which has now been successfully released as `Windows Terminal v1.1.2021.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.1.2021.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6915, which has now been successfully released as Windows Terminal Preview v1.2.2022.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6915, which has now been successfully released as `Windows Terminal Preview v1.2.2022.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.2.2022.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Author
Owner

@ghost commented on GitHub (Jul 22, 2020):

:tada:This issue was addressed in #6833, which has now been successfully released as Windows Terminal Preview v1.2.2022.0.🎉

Handy links:

@ghost commented on GitHub (Jul 22, 2020): :tada:This issue was addressed in #6833, which has now been successfully released as `Windows Terminal Preview v1.2.2022.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v1.2.2022.0) * [Store Download](https://www.microsoft.com/store/apps/9n8g5rfz9xk3?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#7416