Terminal: Investigate: AcrylicBlur always on in an inactive window

Created on 3 Aug 2020  路  18Comments  路  Source: microsoft/terminal

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.

Terminal

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.

Area-Settings Area-TerminalControl Help Wanted Issue-Task Product-Terminal

Most helpful comment

If you'd like to do this, you'll need to copy the HostBackdropAcrylicBrush from here, put port the code to C++/WinRT. If you can egt the brush working as a replacement to the standard AcrylicBrush, then I can help figure out the setting later 馃槤

The Terminal is a C++/WinRT application, which means many of the same APIs that are available to UWP apps are availabie to use in C++, just via their C++ projection instead of the C# one.

The Terminal isn't really a "UWP" app - it uses "UWP XAML" for its UI, but typically UWP also implies some other restrictions like needing to run in an app container. The Terminal is one of a new breed of hybrid Win32/UWP applications that get to use the best of both worlds.

Also FYI UWP applications don't _need_ to be written in C# - you could have a pure UWP app built with C++ if you wanted 馃槈

All 18 comments

I've seen it in other UWP apps so it is possible.

Which applications have you seen this in? The system standard AcrylicBrush (the one we're using) disables acrylic when the window loses focus, which isn't something we can control.

@zadjii-msft I've definitely seen it in a couple of apps, this one comes to mind first:
https://github.com/JasonStein/Notepads

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:

In addition, both background acrylic and in-app acrylic appear as a solid color:

  • When the user turns off transparency in Settings > Personalization > Color
  • When Battery Saver mode is activated
  • When the app runs on low-end hardware

In addition, only background acrylic will replace its translucency and texture with a solid color:

  • When an app window on desktop deactivates
  • When the Windows app is running on phone, Xbox, HoloLens or tablet mode
    (_emph. added_)

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.

To be fair, Microsoft Fluent Design -> Style for Windows apps -> Acrylic specifically calls out _not_ using acrylic for unfocused windows:

In addition, both background acrylic and in-app acrylic appear as a solid color:

  • When the user turns off transparency in Settings > Personalization > Color
  • When Battery Saver mode is activated
  • When the app runs on low-end hardware

In addition, only background acrylic will replace its translucency and texture with a solid color:

  • When an app window on desktop deactivates
  • When the Windows app is running on phone, Xbox, HoloLens or tablet mode
    (_emph. added_)

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.

Just do it. Everyone wants acrylic in background and blur amount settings.

Just do it. Everyone wants acrylic in background and blur amount settings.

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?

It's an open source project, and we're happy to accept community contributions. This issue is even marked "Help Wanted"
image

which means it's one of the easier tasks for a member of the community to implement.

It's an open source project, and we're happy to accept community contributions. This issue is even marked "Help Wanted"
image

which means it's one of the easier tasks for a member of the community to implement.

Thank you, I will see if I can make a small difference

@zadjii-msft Is it possible to get some guidance on where to make the changes to prohibit solid background on lost focus, as well where to read the settings values. Saw that the repo was written in C++, thought the application was an UWP and written in C#, which would have been much easier for me to start with.

If you'd like to do this, you'll need to copy the HostBackdropAcrylicBrush from here, put port the code to C++/WinRT. If you can egt the brush working as a replacement to the standard AcrylicBrush, then I can help figure out the setting later 馃槤

The Terminal is a C++/WinRT application, which means many of the same APIs that are available to UWP apps are availabie to use in C++, just via their C++ projection instead of the C# one.

The Terminal isn't really a "UWP" app - it uses "UWP XAML" for its UI, but typically UWP also implies some other restrictions like needing to run in an app container. The Terminal is one of a new breed of hybrid Win32/UWP applications that get to use the best of both worlds.

Also FYI UWP applications don't _need_ to be written in C# - you could have a pure UWP app built with C++ if you wanted 馃槈

huh, so this is actually possible on UWP? I always think this "always on faky acrylic" is only possible on desktop apps (with a bunch of undocumented DWM APIs).

I'm not sure if that's possible for a pure UWP app, but the Terminal is fortunately a desktop application, so we don't need to worry about that 馃槈 Plus, the compositor APIs are pretty well documented, so it's not like Notepads is doing anything that's a particularly bad hack.

Interesting. I found acrylic working when terminal is inactive on remote desktop.
https://webmshare.com/wZ6OJ
t1
t2

Was this page helpful?
0 / 5 - 0 ratings