-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Investigate: AcrylicBlur always on in an inactive window #7158
Comments
Which applications have you seen this in? The system standard |
@zadjii-msft I've definitely seen it in a couple of apps, this one comes to mind first: |
Ah yea, that one's special though. They're not using the actual system acrylic brush. They're actually rolling their own acrylic brush, using the same combination of effects as the acrylic brush, but with the "disable when the window loses focus" effect disabled. We absolutely could copy that mechanism (just roll our own), but we just need someone to write that code 😄 I think we've got a dupe sitting around here somewhere for that... |
@zadjii-msft Thanks for the quick reply. I've had the same discussion with the team working on FluentTerminal, they advised me to fork it from NotePads and make a pull-request in the FluentTerminal project. But unfortunately I didn't have the time to complete it. However it would be an awesome feature to have and it follows Microsoft Fluent Design principles. I really hope that there is time to implement this feature in alongside this projects roadmap. Thanks for a great terminal and we are looking forward to the upcoming releases. |
To be fair, Microsoft Fluent Design -> Style for Windows apps -> Acrylic specifically calls out not using acrylic for unfocused windows:
That being said, I'm gonna leave this open for now. If someone wants to add the "unfocused acrylic" brush to the terminal (behind an off-by-default global setting), I'm not really opposed to stopping them tbh. |
Hi all, notepads author here. I am glad to help if you guys don't mind. My two cents regarding to that design principle for how to properly use acrylic effect: They are absolutely right but for apps like terminal, they can be special since they are not product for "average consumer" and I personally treat the terminal as one advanced dev tool. These kind of apps can go out of box here. |
That's totally fair, and we're already outside the box here since the body of the Terminal isn't really a "transient surface" either 😝 |
I wonder if this effect really uses that much GPU so that it's explicitly requested to turn it off on all types of devices. I feel like it should work fine in background on laptops connected to AC and desktop PCs so it's only justifiable for mobile devices or if the energy saving mode is on. With that being said, I really hope WinUI team will reconsider this aspect and make it optional. Unfortunately, I can't remember if there is a ticket in the WinUI repo for this matter. |
This comment has been minimized.
This comment has been minimized.
If you like the idea you could join the dev. effort or like 👍 the post and spread the word so other developer can like 👍 it. The more likes a feature gets the more likely it will be develop. 😎 |
Yes, how hard is joining the dev team? Or can I just contribute? |
Update: the plumbing is going well! |
Got the plumbing done and working now AFAIK! Ofcourse, you'll only see it working when I apply/implement |
A hero was born 😎 It took a while but they say if you’re patient you’ll be rewarded. Anyway after 3 years there you go ;) PS: #11092 will be about enabling opacity as both an appearance setting, allowing it to be set differently in both focused and unfocused terminals. The other part of this PR I will cover in 11092 |
So there's 2 brushes to make the terminal Acrylic: Backdrop and HostBackDrop. I noticed they're somewhat different the HostBackdrop one is brighter and it's more transparent sometimes in the edges. This is the default behaviour of the brushes not much I can do about it. But can use the Backdrop only for unfocused terminals Which one you like better? I posted them below so you can vote. |
HostBackdrop looks better in my opinion - I take it there is no way to implement that for unfocused as well? Keep up the good work! |
No |
## 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) --------- Co-authored-by: Mike Griese <migrie@microsoft.com>
So, this was already merged. May be a bit of a dumb question, but, do we need to wait for an update so that this is available, or can we just take some code and slap it into the settings.json file? |
You can always git clone the developer version from here: https://github.com/microsoft/terminal For more information about when the update will be available exactly in the Terminal Preview version @zadjii-msft can help with that and @DHowett too I think . |
Amazing! Thank you! Great Work! |
For updates on allowing opacity to be set differently in both focused and unfocused terminals. |
@ADPenrose |
@Jaswir You just made my day haha! Thanks a lot c: |
…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: ![unfocused_opacity](https://github.com/microsoft/terminal/assets/15957528/1c38e40b-4678-43ec-b328-ad79d222579f) ![image](https://github.com/microsoft/terminal/assets/15957528/3e3342a8-7908-41db-9c37-26c89f7f2456) ![jolsen](https://github.com/microsoft/terminal/assets/15957528/68553507-d29e-4513-89ce-b1cd305d28b7) ![image](https://github.com/microsoft/terminal/assets/15957528/18864f60-91d0-4159-87da-2b2ee1637a4c) ## `_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 ![runtimeFocusedOpacity](https://github.com/microsoft/terminal/assets/15957528/4de63057-d658-4b5e-99ad-7db050834ade) ![command_pallette_focusswitches](https://github.com/microsoft/terminal/assets/15957528/372526eb-cf0c-40f8-a4e5-a0739f1f0e05) 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: ![skipUnfocusedOpacity_bug](https://github.com/microsoft/terminal/assets/15957528/ecc06dcf-fbef-4fef-a40f-68278fdbfb12) ## 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: ![unfocused_opacity](https://github.com/microsoft/terminal/assets/15957528/1c38e40b-4678-43ec-b328-ad79d222579f) ![image](https://github.com/microsoft/terminal/assets/15957528/3e3342a8-7908-41db-9c37-26c89f7f2456) ![jolsen](https://github.com/microsoft/terminal/assets/15957528/68553507-d29e-4513-89ce-b1cd305d28b7) ![image](https://github.com/microsoft/terminal/assets/15957528/18864f60-91d0-4159-87da-2b2ee1637a4c) ## `_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 ![runtimeFocusedOpacity](https://github.com/microsoft/terminal/assets/15957528/4de63057-d658-4b5e-99ad-7db050834ade) ![command_pallette_focusswitches](https://github.com/microsoft/terminal/assets/15957528/372526eb-cf0c-40f8-a4e5-a0739f1f0e05) 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: ![skipUnfocusedOpacity_bug](https://github.com/microsoft/terminal/assets/15957528/ecc06dcf-fbef-4fef-a40f-68278fdbfb12) ## 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
@Jaswir Any idea if these changes could also be extended to tab-row Acrylic, or would that require a substantial amount of additional work beyond what was already implemented for window background Acrylic? (Not sure whether this would go in a separate issue or not though) |
Proposed feature:
The option to always have AcrylicBlur turned on even when the window loses focus. I'm a power-user and understand the GPU implications if blur is always turned on, but I'm willing to pay that price for the beauty of a blurred background. I've seen it in other UWP apps so it is possible.
Current behavior :
AcrylicBlur is turned off, it dips to the default background color, when the window(terminal) loses focus, which is "default" behavior for UWP.
The text was updated successfully, but these errors were encountered: