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

The color scheme preview in the settings UI no longer works #11893

Closed
j4james opened this issue Dec 7, 2021 · 5 comments · Fixed by #12095
Closed

The color scheme preview in the settings UI no longer works #11893

j4james opened this issue Dec 7, 2021 · 5 comments · Fixed by #12095
Assignees
Labels
Area-Settings UI Anything specific to the SUI Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.

Comments

@j4james
Copy link
Collaborator

j4james commented Dec 7, 2021

Windows Terminal version

Commit 094273b

Windows build number

10.0.19041.1348

Other Software

No response

Steps to reproduce

  1. Open the Settings UI
  2. Navigate to the profile Defaults section.
  3. Select the Appearance tab.
  4. Flip through different Color scheme options while watching the preview window.

Expected Behavior

The preview should update to reflect the selected color scheme.

Actual Behavior

The preview doesn't change.

I did a git bisect of the code, which reported commit 094273b as the point at which this stop working. However, I'm wondering if perhaps it's an interaction between those changes and the color table refactoring I was doing in #11602 and #11784.

@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Dec 7, 2021
@zadjii-msft
Copy link
Member

which reported commit 094273b as the point at which this stop working

That would have been my guess as well. If this is all that broke, that's pretty dang impressive. I'll add this to 1.13 to make sure this gets resolved before shipping. Thanks!

@zadjii-msft zadjii-msft added this to the Terminal v1.13 milestone Dec 7, 2021
@zadjii-msft zadjii-msft added Area-Settings UI Anything specific to the SUI Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Terminal The new Windows Terminal. labels Dec 7, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Dec 7, 2021
@zadjii-msft zadjii-msft added the Help Wanted We encourage anyone to jump in on these. label Dec 7, 2021
@j4james
Copy link
Collaborator Author

j4james commented Dec 7, 2021

FYI, I think this has got something to do with "unfocused appearance". I could "fix" the issue by changing the line below so it always passes in _core.FocusedAppearance():

_UpdateAppearanceFromUIThread(_focused ? _core.FocusedAppearance() : _core.UnfocusedAppearance());

And also changing this call so the parameter hardcoded to true:

_core.ApplyAppearance(_focused);

I'm sure that's not the right solution, but that at least gives you an idea of where things are going wrong. It seems to be attempting to use the unfocused appearance when rendering the preview, and in my case that wasn't actually set to anything.

@j4james
Copy link
Collaborator Author

j4james commented Dec 7, 2021

It looks like the problem is that the preview control is created disabled, and with AllowFocusWhenDisabled set to false. Since it can never gain focus, it always renders with the unfocused appearance.

_previewControl.IsEnabled(false);
_previewControl.AllowFocusWhenDisabled(false);

One possible fix would be to set the _focused property to true by default when TermControl is created, and rely on the control receiving a lost focus event (when not disabled) to change that to false when necessary. The preview control wouldn't receive those events so would always be viewed as focused.

If there are situations where the _focused property has to be false by default, we could always add the initial focus state as a constructor parameter, or maybe add a method to force the focused state.

I don't know much about the UI side of things, though, so maybe it's more complicated than this. Just throwing out some ideas.

@zadjii-msft zadjii-msft self-assigned this Jan 5, 2022
@zadjii-msft
Copy link
Member

Yea, that all makes sense. Messing with _focused might just give us a fix for #11411 too. The trick there though is making sure when you're opening a bunch of panes at once that only the last one actually gets the blinking cursor.

But now I'm looking at the pair of these so hopefully I can come up with something

@ghost ghost added the In-PR This issue has a related PR label Jan 5, 2022
@ghost ghost closed this as completed in #12095 Jan 7, 2022
@ghost ghost added Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Jan 7, 2022
ghost pushed a commit that referenced this issue Jan 7, 2022
This PR makes sure profile appearances in SUI set both focused and unfocused members of the control. I totally forgot about the fact that the control is _unfocused_ in the SUI. Verified manually, I didn't think it deserved a gif.

* regressed in #11619
* Closes #11893
* I work here
@ghost
Copy link

ghost commented Feb 3, 2022

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

Handy links:

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Settings UI Anything specific to the SUI Area-TerminalControl Issues pertaining to the terminal control (input, selection, keybindings, mouse interaction, etc.) Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-0 Bugs that we consider release-blocking/recall-class (P0) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants