[PR #15923] Enable unfocused acrylic #30779

Open
opened 2026-01-31 09:42:54 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/15923

State: closed
Merged: Yes


Summary of the Pull Request

Closes #7158

Enabling Acrylic as both an appearance setting (with all the plumbing), allowing it to be set differently in both focused and unfocused terminals. EnableUnfocusedAcrylic Global Setting that controls if unfocused acrylic is possible so that people can disable that behavior.

References and Relevant Issues

#7158 , references: #15913 , #11092

Detailed Description of the Pull Request / Additional comments

Allowing Acrylic to be set differently in both focused and unfocused terminals:

A

A

B

B

C

C

D

D

"profiles":
{
    "list":
    [
        {
            "commandline": "pwsh.exe",
            "name": "A",
            "unfocusedAppearance":
            {
                "useAcrylic": true,
            },
            "useAcrylic": true,
        },
        {
            "commandline": "pwsh.exe",
            "name": "B",
            "unfocusedAppearance":
            {
                "useAcrylic": false,
            },
            "useAcrylic": true,
        },
        {
            "commandline": "pwsh.exe",
            "name": "C",
            "unfocusedAppearance":
            {
                "useAcrylic": true,
            },
            "useAcrylic": false,
        },
        {
            "commandline": "pwsh.exe",
            "name": "D",
            "unfocusedAppearance":
            {
            },
            "useAcrylic": false,
        },
    ]
}
  • A: AcrylicBlur always on
  • B: Acrylic when focused, not acrylic when unfocused
  • C: Why the hell not. Not Acrylic when focused, Acrylic when unfocused.
  • D: Possible today by not using Acrylic.

EnableUnfocusedACrylic global setting that controls if unfocused acrylic is possible

So that people can disable that behavior:
256926990-3c42d99a-67de-4145-bf41-ce3995035136

Alternate approaches I considered:

Using _InitializeBackgroundBrush call instead of _changeBackgroundColor(bg) in ``TermControl::_UpdateAppearanceFromUIThread. Comments in this function mentioned:

// In the future, this might need to be changed to a
// _InitializeBackgroundBrush call instead, because we may need to
// switch from a solid color brush to an acrylic one.

I considered using this to tackle to problem, but don't see the benefit. The only time we need to update the brush is when the user changes the EnableUnfocusedAcrylic setting which is already covered by fire_and_forget TermControl::UpdateControlSettings

Supporting different Opacity in Focused and Unfocused Appearance???

This PR is split up in two parts #7158 covers allowing Acrylic to be set differently in both focused and unfocused terminals. And EnableUnfocusedAcrylic Global Setting that controls if unfocused acrylic is possible so that people can disable that behavior.

#11092 will be about enabling opacity as both an appearance setting, allowing it to be set differently in both focused and unfocused terminals.

Skipping the XAML for now:

“I actually think we may want to skip the XAML on this one for now. We've been having some discussions about compatibility settings, global settings, stuff like this, and it might be _more- confusing to have you do something here. We can always add it in post when we decide where to put it.”
-- Mike Griese

Validation Steps Performed

When Scrolling Mouse , opacity changes appropriately, on opacity 100 there are no gray lines or artefacts

edgecase_scrollwheel

image

When Adjusting Opacity through command palette, opacity changes appropriately, on opacity 100 there are no gray lines or artefacts

edgecase_adjustopacity

image

When opening command palette state goes to unfocused, the acrylic and color change appropriately

edge_case_command_palette

image

Stumbled upon a new bug when performing validation steps #15913

264637964-494d4417-6a35-450a-89f7-52085ef9b546

PR Checklist

**Original Pull Request:** https://github.com/microsoft/terminal/pull/15923 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request Closes #7158 Enabling Acrylic as both an appearance setting (with all the plumbing), allowing it to be set differently in both focused and unfocused terminals. EnableUnfocusedAcrylic Global Setting that controls if unfocused acrylic is possible so that people can disable that behavior. ## References and Relevant Issues #7158 , references: #15913 , #11092 ## Detailed Description of the Pull Request / Additional comments ### Allowing Acrylic to be set differently in both focused and unfocused terminals: #### A ![A](https://github.com/microsoft/terminal/assets/15957528/c43965f2-f458-46ae-af1c-a2107dac981a) #### B ![B](https://github.com/microsoft/terminal/assets/15957528/e84ef1a8-8f4c-467a-99c2-9427061b3e3e) #### C ![C](https://github.com/microsoft/terminal/assets/15957528/63fd35ba-a55a-4c1a-8b1c-5b571aa902ed) #### D ![D](https://github.com/microsoft/terminal/assets/15957528/05108166-1c6e-406e-aec0-80023fc3f57c) ``` json "profiles": { "list": [ { "commandline": "pwsh.exe", "name": "A", "unfocusedAppearance": { "useAcrylic": true, }, "useAcrylic": true, }, { "commandline": "pwsh.exe", "name": "B", "unfocusedAppearance": { "useAcrylic": false, }, "useAcrylic": true, }, { "commandline": "pwsh.exe", "name": "C", "unfocusedAppearance": { "useAcrylic": true, }, "useAcrylic": false, }, { "commandline": "pwsh.exe", "name": "D", "unfocusedAppearance": { }, "useAcrylic": false, }, ] } ``` - **A**: AcrylicBlur always on - **B**: Acrylic when focused, not acrylic when unfocused - **C**: Why the hell not. Not Acrylic when focused, Acrylic when unfocused. - **D:** Possible today by not using Acrylic. ### EnableUnfocusedACrylic global setting that controls if unfocused acrylic is possible So that people can disable that behavior: ![256926990-3c42d99a-67de-4145-bf41-ce3995035136](https://github.com/microsoft/terminal/assets/15957528/eef62c14-d2bd-4737-b86e-dcb3588eb8f7) ### Alternate approaches I considered: Using `_InitializeBackgroundBrush` call instead of `_changeBackgroundColor(bg) in ``TermControl::_UpdateAppearanceFromUIThread`. Comments in this function mentioned: ``` *.cs' // In the future, this might need to be changed to a // _InitializeBackgroundBrush call instead, because we may need to // switch from a solid color brush to an acrylic one. ``` I considered using this to tackle to problem, but don't see the benefit. The only time we need to update the brush is when the user changes the `EnableUnfocusedAcrylic ` setting which is already covered by `fire_and_forget TermControl::UpdateControlSettings` ### Supporting different Opacity in Focused and Unfocused Appearance??? This PR is split up in two parts #7158 covers allowing Acrylic to be set differently in both focused and unfocused terminals. And EnableUnfocusedAcrylic Global Setting that controls if unfocused acrylic is possible so that people can disable that behavior. #11092 will be about enabling opacity as both an appearance setting, allowing it to be set differently in both focused and unfocused terminals. ### Skipping the XAML for now: “I actually think we may want to skip the XAML on this one for now. We've been having some discussions about compatibility settings, global settings, stuff like this, and it might be _more- confusing to have you do something here. We can always add it in post when we decide where to put it.” -- Mike Griese ## Validation Steps Performed #### When Scrolling Mouse , opacity changes appropriately, on opacity 100 there are no gray lines or artefacts ![edgecase_scrollwheel](https://github.com/microsoft/terminal/assets/15957528/29a1b11e-05b8-4626-abd2-4f084ae94a8d) ![image](https://github.com/microsoft/terminal/assets/15957528/c05ea435-8867-4804-bcdc-2074df08cec1) #### When Adjusting Opacity through command palette, opacity changes appropriately, on opacity 100 there are no gray lines or artefacts ![edgecase_adjustopacity](https://github.com/microsoft/terminal/assets/15957528/a59b4d6d-f12e-48da-96bb-3eb333ac4637) ![image](https://github.com/microsoft/terminal/assets/15957528/c05ea435-8867-4804-bcdc-2074df08cec1) #### When opening command palette state goes to unfocused, the acrylic and color change appropriately ![edge_case_command_palette](https://github.com/microsoft/terminal/assets/15957528/ec0cd8b5-676e-4235-8231-a10a5689c0b8) ![image](https://github.com/microsoft/terminal/assets/15957528/4300df70-f64b-4001-8731-b3b69471ea78) #### Stumbled upon a new bug when performing validation steps #15913 ![264637964-494d4417-6a35-450a-89f7-52085ef9b546](https://github.com/microsoft/terminal/assets/15957528/fee59c4a-400b-4e40-912b-ea8c638fc979) ## PR Checklist - [x] Closes #7158 - [X] Tests added/passed - [X] Documentation updated - If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx - [x] Schema updated (if necessary)
claunia added the pull-request label 2026-01-31 09:42:54 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#30779