Skip to content

Conversation

@Aliremu
Copy link

@Aliremu Aliremu commented Dec 21, 2025

Summary of the Pull Request

This PR closes #12632 by dimming the caption controls in the titlebar when unfocused. Leaves them intact when in high contrast mode. The color used is borrowed from PowerToy's unfocused color: https://github.com/microsoft/PowerToys/blob/37bd24db365d7bfc3e27fc77d0ac3c0948ffa189/src/settings-ui/Settings.UI/SettingsXAML/Controls/TitleBar/TitleBar.xaml#L179

References and Relevant Issues

#12632
#10401

Detailed Description of the Pull Request / Additional comments

Introduces a _focused boolean to TitlebarControl which is passed into MinMaxCloseControl. Instead of using a new VisualStateGroup, I opted to slot the Unfocused state into CommonStates, this way we prevent any conflicts with Visual Setters, and can preserve animations.

Validation Steps Performed

Tested by hovering and unhovering in focused and unfocused states, as well as in high contrast mode. States are consistent and applied correctly. I did notice that clicking on the titlebar wouldn't put it into focus unless I also moved my mouse though, but that is also present in the release branch.

PR Checklist

@Aliremu
Copy link
Author

Aliremu commented Dec 21, 2025

@Aliremu please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.

@microsoft-github-policy-service agree [company="{your company}"]

Options:

  • (default - no company specified) I have sole ownership of intellectual property rights to my Submissions and I am not making Submissions in the course of work for my employer.
@microsoft-github-policy-service agree
  • (when company given) I am making Submissions in the course of work for my employer (or my employer has intellectual property rights in my Submissions by contract or applicable law). I have permission from my employer to make Submissions and enter into this Agreement on behalf of my employer. By signing below, the defined term “You” includes me and my employer.
@microsoft-github-policy-service agree company="Microsoft"

Contributor License Agreement

@microsoft-github-policy-service agree

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Theming Anything related to the theming of elements of the window Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Dec 21, 2025
@github-actions

This comment has been minimized.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a quick glance, I'm personally not a fan of adding a _focused member to MinMaxCloseControl and TitlebarControl. The concern being that at some point these two may go out of sync (not necessarily in this PR, but in the future).

Since TitlebarControl doesn't really use _focused other than passing it down to MinMaxCloseControl, how about this:

  • remove _focused from TitlebarControl
  • when _titlebar.Focused() is called, instead set it on the MinMaxCloseControl (either replace the code directly or have TitlebarControl::Focused() just set it on the MinMaxCloseControl then)
  • then, you won't need to pass _focused each time you interact with the control. MinMaxCloseControl should then be keeping track of the state directly and make changes appropriately

That should end up reducing the complexity by a bit, and you'll actually use the MinMaxCloseControl::_focused member you added 😉.

Aside from that, I tested the changes locally and it looks/feels great! Thanks for doing this, I'm excited to see it land soon. 😊

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 12, 2026
@microsoft-github-policy-service microsoft-github-policy-service bot removed the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Jan 18, 2026
@Aliremu
Copy link
Author

Aliremu commented Jan 18, 2026

From a quick glance, I'm personally not a fan of adding a _focused member to MinMaxCloseControl and TitlebarControl. The concern being that at some point these two may go out of sync (not necessarily in this PR, but in the future).

Since TitlebarControl doesn't really use _focused other than passing it down to MinMaxCloseControl, how about this:

  • remove _focused from TitlebarControl
  • when _titlebar.Focused() is called, instead set it on the MinMaxCloseControl (either replace the code directly or have TitlebarControl::Focused() just set it on the MinMaxCloseControl then)
  • then, you won't need to pass _focused each time you interact with the control. MinMaxCloseControl should then be keeping track of the state directly and make changes appropriately

That should end up reducing the complexity by a bit, and you'll actually use the MinMaxCloseControl::_focused member you added 😉.

Aside from that, I tested the changes locally and it looks/feels great! Thanks for doing this, I'm excited to see it land soon. 😊

Thanks! I've removed _focused from TitlebarControl and consolidated it into MinMaxCloseControl as its source of truth.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Theming Anything related to the theming of elements of the window Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure caption controls "dim out" when window loses NC focus (WM_NCACTIVATE?)

2 participants