-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Add support for Acrylic and Opacity in "Unfocused Appearance" #11092
Comments
You know, we don't have an issue tracking this specific task, so congratulations, this is now that thread. We need to first do #7158 to allow unfocused windows to have acrylic at all. Once that's done, we can add it back to the |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
For testing purposes: settings: {
"commandline": "cmd.exe",
"hidden": false,
"name": "unfocused acrylic, 20%",
"useAcrylic": true,
"opacity": 20,
"colorScheme": "Campbell",
"background": "#00ff00",
"unfocusedAppearance":
{
"background": "#0000ff"
}
},
{
"commandline": "cmd.exe",
"hidden": false,
"name": "focused only acrylic, 20%",
"useAcrylic": true,
"opacity": 20,
"colorScheme": "Campbell",
"background": "#00ff00",
"unfocusedAppearance":
{
"background": "#0000ff",
"useAcrylic": false,
}
},
{
"commandline": "cmd.exe",
"hidden": false,
"name": "focused only 100%",
"useAcrylic": true,
"opacity": 20,
"colorScheme": "Campbell",
"background": "#00ff00",
"unfocusedAppearance":
{
"background": "#0000ff",
"opacity": 100,
}
} State: {
"action" : "newTab",
"commandline" : "cmd.exe",
"profile" : "unfocused acrylic",
"startingDirectory" : null,
"suppressApplicationTitle" : false,
"tabTitle" : "unfocused acrylic"
},
{
"action" : "splitPane",
"commandline" : "cmd.exe",
"profile" : "focused acrylic",
"size" : 0.5,
"split" : "right",
"splitMode" : "manual",
"startingDirectory" : null,
"suppressApplicationTitle" : false,
"tabTitle" : "focused acrylic"
},
{
"action" : "splitPane",
"commandline" : "cmd.exe",
"profile" : "focused only 100%",
"size" : 0.5,
"split" : "down",
"splitMode" : "manual",
"startingDirectory" : null,
"suppressApplicationTitle" : false,
"tabTitle" : "focused only 100%"
},
{
"action" : "focusPane",
"id" : 0
} |
This doesn't work, but is a good start for moving the settings around. The parent commit, 26a8447, does the real hard work. The trick is now figuing out how things like focused/unfocused acrylic works. Like, does "toggle acrylic" only affect the focused appearance? both appearances? That's a good question! That's actually a good question for schemes too. That only applies to focused appearance, so that makes sense that acrylic would be the same.
Yeah, I much agree with this issue. I love the transparency functionality, but seems to have been implemented the wrong way around. When the window loses focus, then I would expect transparency to become effective, becoming opaque when the window gains focus so you can see text more clearly. And perhaps we could define different opacity levels depending on focus state; so typically one would set a higher opacity level when the window gains focus. |
x-linking #7158 (comment). That comment basically describes how to do both of these |
## 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  #### B  #### C  #### D  ``` 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:  ### 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   #### When Adjusting Opacity through command palette, opacity changes appropriately, on opacity 100 there are no gray lines or artefacts   #### When opening command palette state goes to unfocused, the acrylic and color change appropriately   #### Stumbled upon a new bug when performing validation steps #15913  ## 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) --------- Co-authored-by: Mike Griese <[email protected]>
Will keep you up to date with the progress! |
Yes! 🥳 |
…minals (#15974) ## Summary of the Pull Request Closes #11092 Allowing `opacity `to be set differently in both focused and unfocused terminals ## References and Relevant Issues #11092 , references: #7158 ## Detailed Description of the Pull Request / Additional comments ### Allowing Opacity to be set differently in both focused and unfocused terminals:     ## `_runtimeFocusedOpacity` Mike also had to say something about this: #2531 (comment) Initially I had something like ` _setOpacity(newAppearance->Opacity());` But with the introduction of unfocused opacity we encounter new challenges: When Adjusting the Opacity with **CTRL+SHIFT+Mouse Scroll Wheel** or **Set background opacity** in command pallette, the Runtime opacity changes, but when we go to unfocused and back to focused the opacity changes back to focused opacity in Settings. Also when adjusting opacity through the command palette the window becomes unfocused and then focused again after setting background opacity hence the ` _setOpacity(newAppearance->Opacity());` would override the changes made through command palette   With the introduction of unfocused opacity we encounter new challenges. The runtime opacity stores both the unfocused opacity and focused opacity from settings at different moments. This all works well until we combine this with Adjusting the Opacity with **CTRL+SHIFT+Mouse Scroll Wheel** or **Set background opacity** in command pallette. This brings the need for a separate Focused Opacity. When we change the runtime opacity with scroll wheel or through command pallette this value needs to be stored separately from the one in settings. So we can change back to it when going to unfocused mode and back to focused instead of the focused opacity defined in settings. ## `skipUnfocusedOpacity` solves Opacity going from solid to unfocused to focused bug:  ## Validation Steps Performed - Checked if unfocused Opacity works well when adjusting opacity through Mouse Scroll Wheel or Command Palette and in combination with Acrylic as mentioned in "Detailed Description of the Pull Request / Additional comments" ## PR Checklist - [x] Closes #11092 - [ ] 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:(MicrosoftDocs/terminal#714) - [ ] Schema updated (if necessary)
…minals (#15974) ## Summary of the Pull Request Closes #11092 Allowing `opacity `to be set differently in both focused and unfocused terminals ## References and Relevant Issues #11092 , references: #7158 ## Detailed Description of the Pull Request / Additional comments ### Allowing Opacity to be set differently in both focused and unfocused terminals:     ## `_runtimeFocusedOpacity` Mike also had to say something about this: #2531 (comment) Initially I had something like ` _setOpacity(newAppearance->Opacity());` But with the introduction of unfocused opacity we encounter new challenges: When Adjusting the Opacity with **CTRL+SHIFT+Mouse Scroll Wheel** or **Set background opacity** in command pallette, the Runtime opacity changes, but when we go to unfocused and back to focused the opacity changes back to focused opacity in Settings. Also when adjusting opacity through the command palette the window becomes unfocused and then focused again after setting background opacity hence the ` _setOpacity(newAppearance->Opacity());` would override the changes made through command palette   With the introduction of unfocused opacity we encounter new challenges. The runtime opacity stores both the unfocused opacity and focused opacity from settings at different moments. This all works well until we combine this with Adjusting the Opacity with **CTRL+SHIFT+Mouse Scroll Wheel** or **Set background opacity** in command pallette. This brings the need for a separate Focused Opacity. When we change the runtime opacity with scroll wheel or through command pallette this value needs to be stored separately from the one in settings. So we can change back to it when going to unfocused mode and back to focused instead of the focused opacity defined in settings. ## `skipUnfocusedOpacity` solves Opacity going from solid to unfocused to focused bug:  ## Validation Steps Performed - Checked if unfocused Opacity works well when adjusting opacity through Mouse Scroll Wheel or Command Palette and in combination with Acrylic as mentioned in "Detailed Description of the Pull Request / Additional comments" ## PR Checklist - [x] Closes #11092 - [ ] 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:(MicrosoftDocs/terminal#714) - [ ] Schema updated (if necessary) (cherry picked from commit 27e1081) Service-Card-Id: 90949918 Service-Version: 1.19
Please add "Acrylic" setting support to unfocused appearance options being introduced in PR #10317
I'd really like to make my unfocused windows to have transparency instead of opaque. Ideally, I could make my unfocused windows more transparent than my focused window.
Right now, since unfocused windows are opaque, they appear more predominant on the desktop than the focused window appears when configured with acrylic enabled and semi-transparent.
The text was updated successfully, but these errors were encountered: