Repository: microsoft/terminal (language: cpp)

Issue:
Investigate: AcrylicBlur always on in an inactive window
**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](https://user-images.githubusercontent.com/17148955/89184781-96817300-d599-11ea-8962-2907f707341d.png)



**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.


Discussion / hints:
>  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](https://github.com/felixse/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](https://www.microsoft.com/design/fluent/#/) 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](https://www.microsoft.com/design/fluent/#/windows) -> [Style for Windows apps](https://docs.microsoft.com/en-us/windows/uwp/design/style/) -> [Acrylic](https://docs.microsoft.com/en-us/windows/uwp/design/style/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](https://www.microsoft.com/design/fluent/#/windows) -> [Style for Windows apps](https://docs.microsoft.com/en-us/windows/uwp/design/style/) -> [Acrylic](https://docs.microsoft.com/en-us/windows/uwp/design/style/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](https://github.com/microsoft/terminal/blob/master/CONTRIBUTING.md#terminal-contributors-guide). 😎
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](https://user-images.githubusercontent.com/18356694/89525253-83de8800-d7ab-11ea-9ed4-8586a2658af1.png)

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](https://user-images.githubusercontent.com/18356694/89525253-83de8800-d7ab-11ea-9ed4-8586a2658af1.png)
> 
> 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](https://github.com/JasonStein/Notepads/blob/master/src/Notepads/Brushes/HostBackdropAcrylicBrush.cs), 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](https://user-images.githubusercontent.com/54934396/96256544-75062400-0feb-11eb-8dc0-6dd8b2c202e5.png)
![t2](https://user-images.githubusercontent.com/54934396/96256556-77687e00-0feb-11eb-9f5c-b29ebb35a03d.png)
Could it just paint part of the desktop wallpaper with a glass effect instead of actually using Acrylic? Or maybe have that as an option?

Some old Linux terminals in the early 2000s did a thing where it would just paint the desktop wallpaper image at reduced contrast, and it would move the source rect based on where the window was relative to the wallpaper.

This has a few advantages:

- It isn't subject to Windows' Glass/Acrylic rules
- The user can choose a wallpaper they like and that won't clash with the text color
- The effect can be cached (although I think the perf/energy issue is way overstated -- see below)

I made a mockup a couple years ago in WPF:

![ezgif-7-ad2b25eee91b](https://user-images.githubusercontent.com/5127297/100915923-e7db3980-3489-11eb-9c72-9150b9059149.gif)

I think in a real Windows app, in order for there not to be juddering, it would need to either be able to redraw as soon as the window moves (I never figured out how to do this), or just not update the background for half a second or so after the window stops moving.

> 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.

Even back on Vista hardware back in 2007, when there were a ton of false rumors about its resource consumption, Aero Glass being a culprit for battery consumption was ruled out by anyone who tested the theory both in benchmarks and in practical use. It was reducing battery life by less than 1%. The only modern computer I can think of that wouldn't have a GPU that could handle glass in under 0.1% of its energy consumption is a Raspberry Pi.
Just a quick thought: https://github.com/microsoft/terminal/pull/8392 introduced style settings for when the terminal is unfocused. This (probably) means that, once this feature is implemented/ported, the `Enable Acrylic` setting could just be duplicated to give the user more control how they want the effect to behave.  
For example, I'd actually like the effect to *only* show when the window in unfocused, so that it "blends in" with the background.  

Making use of the linked PR would enable this right away, basically without any additional overhead :)
Just chiming in with a use case beyond "it looks pretty" because I don't think it's been mentioned yet - this would be super useful combined with the 'Always on top' appearance setting to let me keep a terminal window visible without it obscuring other stuff on the same monitor. I often want to keep an eye on something running in terminal like a build while not really interacting with it much.

Ideally there would be a separate opacity setting for focused and unfocused.
Hey all, is anyone currently working on this? This is something I would really love and am willing to have a go at implementing it.
No one's working on this currently, so go right ahead! You might want to take a look at 

https://github.com/JasonStein/Notepads/blob/8ea2c902c1b1a35deb913503559c40e18708c9e5/src/Notepads/Brushes/HostBackdropAcrylicBrush.cs

as a starting place. That's C#, but it'll be a fairly good reference for what needs to be done here. I'd also recommend maybe branching off of #11180, since that slightly re-works how opacity works in the Terminal
@zadjii-msft, thanks for the pointers 😄 will take a look at these for some guidance. Also, it seems like the branch/PR you commented isn't passing though.
Also; side note, I was building the dev branch to make sure I can but it runs super slow, is there any tricks to make the build quicker (like a --skipTests or smth in C++)
> Also, it seems like the branch/PR you commented isn't passing though.

Meh yea, I forgot to build some of the test code. Don't worry too much about those ones not building, I'll go sort those out now.



> Also; side note, I was building the dev branch to make sure I can but it runs super slow, is there any tricks to make the build quicker (like a --skipTests or smth in C++)

Yea, that's kinda been a crusade I've been pushing for a while. C++/WinRT code can be a real pain to build, especially the first time when it's compiling the `pch.h`'s. My trick is only ever deploying CascadiaPackage:
![image](https://user-images.githubusercontent.com/18356694/133246555-75192b0f-c0bc-4952-8413-fc512de4976c.png)

That'll skip all the test projects, and just build the Terminal. That's usually good enough for my inner loop. I had a more complicated setup too where I'd only ever build individual dll's, and then patch them into the package directory, but that's more fraught with footguns so I'll not go into details on that 😛 
Awesome! Thanks for the help / advice, I will have a look at pulling the branch and building it. 

>Yea, that's kinda been a crusade I've been pushing for a while. C++/WinRT code can be a real pain to build, especially the first time when it's compiling the pch.h's. My trick is only ever deploying CascadiaPackage:

Thanks, I'll give this a try and hope it builds quicker :)

> I had a more complicated setup too where I'd only ever build individual dll's, and then patch them into the package directory, but that's more fraught with footguns so I'll not go into details on that 😛

As a newbie I will skip your perilous setup 😆 
any updates on this?
Nope. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
![image](https://user-images.githubusercontent.com/18356694/91237459-5cbb0c80-e700-11ea-9347-b9b1ec2813b1.png)
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️
Weirdly here on Windows 11 build 22509.1011, acrylic stopped working entirely both on the stable and preview releases -- so I initially went to fix that, and then additionally was able to fix the acrylic on focused and non-focused states.

Not the cleanest, at all!! But I patched this issue: https://github.com/Wabi-Studios/Windows-Always-Blurred-Terminal

Can clean it way up for an actual PR if you guys are interested. Was messing with a bunch of things when I was in there, haha.

I can provide a build when I get the chance to fix the deployment on azure.
@furby-tm Interesting. Looking through that diff is... challenging, since there's so many other random dependency updates and merges in it. But it looks like the substantial part of it boils down to 
* Add `mux:BackdropMaterial.ApplyToRootOrPageBackground="True"` to the root `TerminalPage`
* change any acrylic brushes we're using to `BackgroundSource(AcrylicBackgroundSource::Backdrop)` instead of `AcrylicBackgroundSource::HostBackdrop`

any idea _why_ that fixes it? The [`BackdropMaterial.ApplyToRootOrPageBackground` docs](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.backdropmaterial.applytorootorpagebackground?view=winui-2.7) are... sparse... I was under the impression that was only supposed to work with Mica, but if that works with Acrylic too, that's a nifty discovery.

I'm a tad bit worried that the `<Grid x:Name="Root" Background="{ThemeResource CustomAcrylicInAppLuminosity}">` bit is making it hard for the `TermControl`s to be able to set their own individual colors/BG brushes, but that could probably get sorted out. I'm mostly just curious _how_ this works. We'd obviously accept a (cleaned up 🤣) PR. This seems way simpler than the Notepads solution.
@zadjii-msft  Oh my! Haha. You actually read through that terrible commit 🤣! I am terribly sorry -- Yes that about sums it up! And actually I don't believe applying the Mica material is of much use here, in terms of acrylic; and 

Re:
_change any acrylic brushes we're using to BackgroundSource(AcrylicBackgroundSource::Backdrop) instead of AcrylicBackgroundSource::HostBackdrop_

You are spot on with this, on top of this, I found many unnecessary bits on the usage of `SolidBrush` vs just using the `AcrylicBrush` -- especially as it pertains to the background's brush. And the only reason I implemented `<Grid x:Name="Root" Background="{ThemeResource CustomAcrylicInAppLuminosity}">` was because on this Windows 11 build **22509.1011** , that acrylic is the only one working:
![image](https://user-images.githubusercontent.com/18516968/144871157-cf9e6bb3-5756-4732-8aa2-abcb449296e4.png)

As seen by the XAML Controls Gallery here ^ But that's a separate issue, haha.

But yes, I can definitely go back and make a commit less than 25 lines of code most likely.

WOW! I am so sorry you had to read through all of that 🤦
> on this Windows 11 build **22509.1011** , that acrylic is the only one working

Oh jeez, you might be running into #11880, which is an OS level bug 😨 
@zadjii-msft Yep! Haha I live and work out of my terminal and could not stand another second of opaqueness, so I needed to solve it ASAP. And while I was at it, it seemed simple enough to figure out a solution to the extremely annoying "unblur" when moving off focus, and it sure was! 

So maybe thank goodness for the occasional OS level bug to start thinking outside the box a little bit 😉

I do have a job, so you should see a polished PR by sometime late tonight - and as well as my temporary workaround to get acrylic working on build **22509.1011** if a OS patch isn't expected anytime soon.

#7158  #11880 

Who doesn't like killing two birds with one stone?

---

Quick update, been a busy week. But have not forgotten and am still planning on making a PR when I get some down time. @zadjii-msft just keep me posted if someone gets to fixing this before I get a chance to, much appreciated!
@furby-tm maybe you could join your solution with the "Unfocused Appearance" menu available in [Terminal Preview](https://www.microsoft.com/it-it/p/windows-terminal-preview/9n8g5rfz9xk3) (PR #10317) by also solving #11092
@furby-tm  Is your current version "always blurred terminal" good/stable enough for installing it instead of the original one?  I can't stand much more time in opaqueness too, Thanks in advance!
Yes funny enough I actually have been using that build as my daily driver. And sorry guys! I've been super busy!! You guys still want that build? Cleaned up pr?
I would still love to see a (cleaned up 😉) PR 
Sure! and thanks for your reply @furby-tm! It would be amazing to have this feature implemented! Count on me if you need some help testing, or something.
@furby-tm Could you provide a working build? I cloned and built your repository, however, I was not able to reproduce the Acrylic Blur effect with an unfocused window. I tried it on Windows 10 (build 19043.1466) and with a recent Windows 11 installation. Do I have to pay attention to anything in particular? Interestingly, the whole thing works when I connect to the respective machine via RDP.
FWIW, when I looked through @furby-tm's fork, I didn't find anything that I would expect to actually fix this. I'm still under the impression that we'd need to roll our own fork of the acrylic brush, in the same way that Notepads does. 

I have seen situations in debugging VMs where acrylic was always on (focused or not), but that seemed to be an artifact of the VM, and not something reproducible on a real machine. Perhaps that artifact is what made that fork seemingly work? Only way to know for sure is to get a PR going and test it put locally 😉 
Just some notes as we punt this one out:


* After the recent change to have a fully transparent BG for the Terminal HWND, this is actually super trivial. Instead of using HostBackdrop acrylic, we can just achieve this with in-app acrylic, because the back of the app _is transparent_. It's like, a 1 LOC change.
* Actually doing this requires a bit more work. 
  * We need do to this with a setting to enable inactive acrylic, because of battery life concerns. 
    * Should this be a global or per-profile setting? That's something to consider.
  * We need to also make sure we contemporaneously do #11092, to make sure that we can actually tell the Control layer to be transparent even in an unfocused appearance.
    * This could probably be done as a precursor PR to actually implementing `allowUnfocusedAcrylic` as a setting.
  * We should also consider that "Battery Saver Mode" should manually override this setting. See also #9600. 
    * Though, if this were gonna come from a community member, I'm okay ignoring those concerns for now
  
If someone would like to help sort these things out all at once, we'd definitely appreciate the help. 

<hr>

> **Note**
> ## Walkthrough

* I'd take a look at `ControlAppearance.idl`, and `ControlProperties.h`. 
  * Move acrylic from `CONTROL_SETTINGS` to `CONTROL_APPEARANCE_SETTINGS`. 
  * Add a `CONTROL_SETTINGS` for `EnableUnfocusedAcrylic`
* In `MTSMSettings.h`, 
  * add a new global boolean `X(bool, EnableUnfocusedAcrylic, "comaptibility.enableUnfocusedAcrylic", true)`
  * Similarly to above, move `useAcrylic` from `MTSM_PROFILE_SETTINGS` to `MTSM_APPEARANCE_SETTINGS`
* Use the global setting when constructing a `TerminalSettings` in `TerminalSettings::_ApplyAppearanceSettings`
* In `TermControl.cpp`, if `EnableUnfocusedAcrylic` is set, then switch the backdrop from `acrylic.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);` to `Backdrop`


I think that's it?
Is there a solution now?
Some updates?
Nope, nothing to add. We'll make sure to update this thread when there is. In the meantime, might I recommend the Subscribe button?
![image](https://user-images.githubusercontent.com/18356694/91237459-5cbb0c80-e700-11ea-9347-b9b1ec2813b1.png)
That way you'll be notified of any updates to this thread, without needlessly pinging everyone on this thread ☺️

We basically just need someone to take the notes I outlined [above](https://github.com/microsoft/terminal/issues/7158#issuecomment-1162080143), and just do it. There hasn't been any time for us on the team to do it in the last year. I could write up more specific notes if someone was really interested on doing this themselves. Though, I'd caution - it'll likely be 95% annoying plumbing work, and 5% "just switch the backdrop to in-app acrylic"
I am also an advanced user and I agree with everyone here, you want to at least keep the behavior when unfocused keep the acrilyc effect at least
+1 on the "I would really like this feature" and make it a per user setting please.
Hey @zadjii-msft! I am really interested in giving this a shot. I would love some tips and notes, as I am not extremely familiar with the Terminal repository. I have read the notes you shared earlier, and I believe I have a good idea of how to start. However, I would appreciate notes on what to look out for as I start working on this. Thanks! 
Having things in Gifs describing the issue helps me. 
Maybe it'll help get this solved faster:

![Focussed-Unfocussed-Opacity](https://github.com/microsoft/terminal/assets/15957528/97536c9d-9f46-4fc7-a1a2-f3c075bf40c7)

@AbdullahAlmanei Sorry, got bogged down with Build prep. Honestly, I think the notes just about cover it. The core implementation point of this (switching the `AcrylicBrush` in the `TermControl` from `hostBackdrop` to in-app acrylic) _I think_ is a pretty straightforward change, it's just the plumbing of the settings that might be a bit tedious.

If I'm wrong though and you hit any snags, please feel free to ping me!
@Jaswir The same behavior can be simulated if you make a cutout of the background when it is in acrylic, then in the active settings the background when the focus is not there, the only bad thing is that if you change the background of the desktop it will not have the same effect.
@AbdullahAlmanei 

Are you working on this? Or? I would assume that since it's been about 2 months now I can savely assume you aren't?

 This one seems like fun to me.
@Jaswir 
Not currently, would love to see what you will do with it!

![start_plumbing](https://github.com/microsoft/terminal/assets/15957528/1da3955e-7bea-4320-b3f0-caf8ca1e463e)

Amazing. Great work @Jaswir 
It's the plumbing that's the hard part ... Don't get too excited yet,  this was the easy part.  But any positive feedback will help motivate me <3
Sure -- but if you get stuck I'm sure someone would be happy to pick up where you left off :) Seeing that it's possible at all is the most important thing.

Do we have a consensus on which options to change/add? This will change existing behavior, so I wonder if we need to find a way to migrate previous users in such a way that it won't change for them. For example, maybe two settings:
- Focused Window Appearance: Acrylic/Solid
- Unfocused Window Appearance: Acrylic/Solid

Then we can migrate the existing users to Focused:Acrylic, Unfocused:Solid. These two options also give more customization; for example I suspect a lot of people will want it reversed -- have it be solid when focused, acrylic when unfocused.

And then of course for low power mode / battery saver, we override and choose Solid always.

Just my two cents -- I have no authority in the matter.

Fix patch:
diff --git a/doc/cascadia/profiles.schema.json b/doc/cascadia/profiles.schema.json
index 50a8a6a854f..d43a9e4e7d8 100644
--- a/doc/cascadia/profiles.schema.json
+++ b/doc/cascadia/profiles.schema.json
@@ -269,6 +269,10 @@
         "experimental.pixelShaderPath": {
           "description": "Use to set a path to a pixel shader to use with the Terminal when unfocused. Overrides `experimental.retroTerminalEffect`. This is an experimental feature, and its continued existence is not guaranteed.",
           "type": "string"
+        },
+        "useAcrylic":{
+          "description": "When set to true, the window will have an acrylic material background when unfocused. When set to false, the window will have a plain, untextured background when unfocused.",
+          "type": "boolean"
         }
       },
       "type": "object"
@@ -2173,6 +2177,11 @@
           "description": "When set to true, tabs are always displayed. When set to false and \"showTabsInTitlebar\" is set to false, tabs only appear after opening a new tab.",
           "type": "boolean"
         },
+        "compatibility.enableUnfocusedAcrylic":{
+          "default": true,
+          "description": "When set to true, unfocused windows can have acrylic instead of opaque.",
+          "type": "boolean"
+        },
         "centerOnLaunch": {
           "default": false,
           "description": "When set to `true`, the terminal window will auto-center itself on the display it opens on. The terminal will use the \"initialPosition\" to determine which display to open on.",
diff --git a/src/cascadia/TerminalControl/ControlCore.cpp b/src/cascadia/TerminalControl/ControlCore.cpp
index 7530909aaab..52dc7d4087f 100644
--- a/src/cascadia/TerminalControl/ControlCore.cpp
+++ b/src/cascadia/TerminalControl/ControlCore.cpp
@@ -868,7 +868,24 @@ namespace winrt::Microsoft::Terminal::Control::implementation
             _renderEngine->SetSelectionBackground(til::color{ newAppearance->SelectionBackground() });
             _renderEngine->SetRetroTerminalEffect(newAppearance->RetroTerminalEffect());
             _renderEngine->SetPixelShaderPath(newAppearance->PixelShaderPath());
-            _renderer->TriggerRedrawAll();
+
+            // No need to update Acrylic if UnfocusedAcrylic is disabled
+            if (_settings->EnableUnfocusedAcrylic())
+            {
+                // Manually turn off acrylic if they turn off transparency.
+                _runtimeUseAcrylic = Opacity() < 1.0 && newAppearance->UseAcrylic();
+
+                // Update the renderer as well. It might need to fall back from
+                // cleartype -> grayscale if the BG is transparent / acrylic.
+                _renderEngine->EnableTransparentBackground(_isBackgroundTransparent());
+                _renderer->NotifyPaintFrame();
+
+                auto eventArgs = winrt::make_self<TransparencyChangedEventArgs>(Opacity());
+
+                _TransparencyChangedHandlers(*this, *eventArgs);
+            }
+
+            _renderer->TriggerRedrawAll(true, true);
         }
     }
 
diff --git a/src/cascadia/TerminalControl/IControlAppearance.idl b/src/cascadia/TerminalControl/IControlAppearance.idl
index 96c3db75a11..124eb641ba1 100644
--- a/src/cascadia/TerminalControl/IControlAppearance.idl
+++ b/src/cascadia/TerminalControl/IControlAppearance.idl
@@ -13,6 +13,7 @@ namespace Microsoft.Terminal.Control
         Windows.UI.Xaml.VerticalAlignment BackgroundImageVerticalAlignment { get; };
         // IntenseIsBold and IntenseIsBright are in Core Appearance
         Double Opacity { get; };
+        Boolean UseAcrylic { get; };
 
         // Experimental settings
         Boolean RetroTerminalEffect { get; };
diff --git a/src/cascadia/TerminalControl/IControlSettings.idl b/src/cascadia/TerminalControl/IControlSettings.idl
index f03981f64cf..a64dd4f7987 100644
--- a/src/cascadia/TerminalControl/IControlSettings.idl
+++ b/src/cascadia/TerminalControl/IControlSettings.idl
@@ -31,7 +31,7 @@ namespace Microsoft.Terminal.Control
         String ProfileName;
         String ProfileSource;
 
-        Boolean UseAcrylic { get; };
+        Boolean EnableUnfocusedAcrylic;
         ScrollbarState ScrollState { get; };
 
         Boolean UseAtlasEngine { get; };
diff --git a/src/cascadia/TerminalControl/TermControl.cpp b/src/cascadia/TerminalControl/TermControl.cpp
index fedd24f8e14..d26adcaead6 100644
--- a/src/cascadia/TerminalControl/TermControl.cpp
+++ b/src/cascadia/TerminalControl/TermControl.cpp
@@ -733,7 +733,15 @@ namespace winrt::Microsoft::Terminal::Control::implementation
             if (acrylic == nullptr)
             {
                 acrylic = Media::AcrylicBrush{};
-                acrylic.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
+
+                if (_core.Settings().EnableUnfocusedAcrylic())
+                {
+                    acrylic.BackgroundSource(Media::AcrylicBackgroundSource::Backdrop);
+                }
+                else
+                {
+                    acrylic.BackgroundSource(Media::AcrylicBackgroundSource::HostBackdrop);
+                }
             }
 
             // see GH#1082: Initialize background color so we don't get a
diff --git a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h
index 0946d9146ad..e752c8cffca 100644
--- a/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h
+++ b/src/cascadia/TerminalSettingsEditor/ProfileViewModel.h
@@ -87,7 +87,6 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
         OBSERVABLE_PROJECTED_SETTING(_profile, TabTitle);
         OBSERVABLE_PROJECTED_SETTING(_profile, TabColor);
         OBSERVABLE_PROJECTED_SETTING(_profile, SuppressApplicationTitle);
-        OBSERVABLE_PROJECTED_SETTING(_profile, UseAcrylic);
         OBSERVABLE_PROJECTED_SETTING(_profile, ScrollState);
         OBSERVABLE_PROJECTED_SETTING(_profile, Padding);
         OBSERVABLE_PROJECTED_SETTING(_profile, Commandline);
@@ -98,6 +97,7 @@ namespace winrt::Microsoft::Terminal::Settings::Editor::implementation
         OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), SelectionBackground);
         OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), CursorColor);
         OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), Opacity);
+        OBSERVABLE_PROJECTED_SETTING(_profile.DefaultAppearance(), UseAcrylic);
         OBSERVABLE_PROJECTED_SETTING(_profile, HistorySize);
         OBSERVABLE_PROJECTED_SETTING(_profile, SnapOnInput);
         OBSERVABLE_PROJECTED_SETTING(_profile, AltGrAliasing);
diff --git a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl
index 02b3788b1ed..a1847408fdf 100644
--- a/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl
+++ b/src/cascadia/TerminalSettingsModel/GlobalAppSettings.idl
@@ -99,6 +99,7 @@ namespace Microsoft.Terminal.Settings.Model
         INHERITABLE_SETTING(IVector<NewTabMenuEntry>, NewTabMenu);
         INHERITABLE_SETTING(Boolean, EnableColorSelection);
         INHERITABLE_SETTING(Boolean, EnableShellCompletionMenu);
+        INHERITABLE_SETTING(Boolean, EnableUnfocusedAcrylic);
         INHERITABLE_SETTING(Boolean, IsolatedMode);
         INHERITABLE_SETTING(Boolean, AllowHeadless);
         INHERITABLE_SETTING(String, SearchWebDefaultQueryUrl);
diff --git a/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl b/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl
index 6352de64b08..5161a6716bb 100644
--- a/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl
+++ b/src/cascadia/TerminalSettingsModel/IAppearanceConfig.idl
@@ -54,5 +54,6 @@ namespace Microsoft.Terminal.Settings.Model
         INHERITABLE_APPEARANCE_SETTING(IntenseStyle, IntenseTextStyle);
         INHERITABLE_APPEARANCE_SETTING(Microsoft.Terminal.Core.AdjustTextMode, AdjustIndistinguishableColors);
         INHERITABLE_APPEARANCE_SETTING(Double, Opacity);
+        INHERITABLE_APPEARANCE_SETTING(Boolean, UseAcrylic);
     };
 }
diff --git a/src/cascadia/TerminalSettingsModel/MTSMSettings.h b/src/cascadia/TerminalSettingsModel/MTSMSettings.h
index 6276c3d1354..6c7b08649f9 100644
--- a/src/cascadia/TerminalSettingsModel/MTSMSettings.h
+++ b/src/cascadia/TerminalSettingsModel/MTSMSettings.h
@@ -64,6 +64,7 @@ Author(s):
     X(bool, TrimPaste, "trimPaste", true)                                                                                                                                                             \
     X(bool, EnableColorSelection, "experimental.enableColorSelection", false)                                                                                                                         \
     X(bool, EnableShellCompletionMenu, "experimental.enableShellCompletionMenu", false)                                                                                                               \
+    X(bool, EnableUnfocusedAcrylic, "compatibility.enableUnfocusedAcrylic", true)                                                                                                                     \
     X(winrt::Windows::Foundation::Collections::IVector<Model::NewTabMenuEntry>, NewTabMenu, "newTabMenu", winrt::single_threaded_vector<Model::NewTabMenuEntry>({ Model::RemainingProfilesEntry{} })) \
     X(bool, AllowHeadless, "compatibility.allowHeadless", false)                                                                                                                                      \
     X(bool, IsolatedMode, "compatibility.isolatedMode", false)                                                                                                                                        \
@@ -79,7 +80,6 @@ Author(s):
     X(int32_t, HistorySize, "historySize", DEFAULT_HISTORY_SIZE)                                                                                               \
     X(bool, SnapOnInput, "snapOnInput", true)                                                                                                                  \
     X(bool, AltGrAliasing, "altGrAliasing", true)                                                                                                              \
-    X(bool, UseAcrylic, "useAcrylic", false)                                                                                                                   \
     X(hstring, Commandline, "commandline", L"%SystemRoot%\\System32\\cmd.exe")                                                                                 \
     X(Microsoft::Terminal::Control::ScrollbarState, ScrollState, "scrollbarState", Microsoft::Terminal::Control::ScrollbarState::Visible)                      \
     X(Microsoft::Terminal::Control::TextAntialiasingMode, AntialiasingMode, "antialiasingMode", Microsoft::Terminal::Control::TextAntialiasingMode::Grayscale) \
@@ -128,7 +128,8 @@ Author(s):
     X(ConvergedAlignment, BackgroundImageAlignment, "backgroundImageAlignment", ConvergedAlignment::Horizontal_Center | ConvergedAlignment::Vertical_Center)       \
     X(hstring, BackgroundImagePath, "backgroundImage")                                                                                                             \
     X(Model::IntenseStyle, IntenseTextStyle, "intenseTextStyle", Model::IntenseStyle::Bright)                                                                      \
-    X(Core::AdjustTextMode, AdjustIndistinguishableColors, "adjustIndistinguishableColors", Core::AdjustTextMode::Never)
+    X(Core::AdjustTextMode, AdjustIndistinguishableColors, "adjustIndistinguishableColors", Core::AdjustTextMode::Never)                                           \
+    X(bool, UseAcrylic, "useAcrylic", false)
 
 // Intentionally omitted Appearance settings:
 // * ForegroundKey, BackgroundKey, SelectionBackgroundKey, CursorColorKey: all optional colors
diff --git a/src/cascadia/TerminalSettingsModel/Profile.idl b/src/cascadia/TerminalSettingsModel/Profile.idl
index 3cfaf96aff9..86bce9beeb4 100644
--- a/src/cascadia/TerminalSettingsModel/Profile.idl
+++ b/src/cascadia/TerminalSettingsModel/Profile.idl
@@ -63,7 +63,6 @@ namespace Microsoft.Terminal.Settings.Model
         INHERITABLE_PROFILE_SETTING(String, TabTitle);
         INHERITABLE_PROFILE_SETTING(Windows.Foundation.IReference<Microsoft.Terminal.Core.Color>, TabColor);
         INHERITABLE_PROFILE_SETTING(Boolean, SuppressApplicationTitle);
-        INHERITABLE_PROFILE_SETTING(Boolean, UseAcrylic);
         INHERITABLE_PROFILE_SETTING(Microsoft.Terminal.Control.ScrollbarState, ScrollState);
         INHERITABLE_PROFILE_SETTING(String, Padding);
         INHERITABLE_PROFILE_SETTING(String, Commandline);
diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp b/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp
index c594d42fb3b..35881c8c715 100644
--- a/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp
+++ b/src/cascadia/TerminalSettingsModel/TerminalSettings.cpp
@@ -257,6 +257,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
 
         _AdjustIndistinguishableColors = appearance.AdjustIndistinguishableColors();
         _Opacity = appearance.Opacity();
+        _UseAcrylic = appearance.UseAcrylic();
     }
 
     // Method Description:
@@ -276,7 +277,6 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
         // Fill in the remaining properties from the profile
         _ProfileName = profile.Name();
         _ProfileSource = profile.Source();
-        _UseAcrylic = profile.UseAcrylic();
 
         const auto fontInfo = profile.FontInfo();
         _FontFace = fontInfo.FontFace();
@@ -356,6 +356,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
         _ForceVTInput = globalSettings.ForceVTInput();
         _TrimBlockSelection = globalSettings.TrimBlockSelection();
         _DetectURLs = globalSettings.DetectURLs();
+        _EnableUnfocusedAcrylic = globalSettings.EnableUnfocusedAcrylic();
     }
 
     // Method Description:
diff --git a/src/cascadia/TerminalSettingsModel/TerminalSettings.h b/src/cascadia/TerminalSettingsModel/TerminalSettings.h
index fe74c26d9d6..daa895518e8 100644
--- a/src/cascadia/TerminalSettingsModel/TerminalSettings.h
+++ b/src/cascadia/TerminalSettingsModel/TerminalSettings.h
@@ -118,6 +118,7 @@ namespace winrt::Microsoft::Terminal::Settings::Model::implementation
         INHERITABLE_SETTING(Model::TerminalSettings, hstring, ProfileName);
         INHERITABLE_SETTING(Model::TerminalSettings, hstring, ProfileSource);
 
+        INHERITABLE_SETTING(Model::TerminalSettings, bool, EnableUnfocusedAcrylic, false);
         INHERITABLE_SETTING(Model::TerminalSettings, bool, UseAcrylic, false);
         INHERITABLE_SETTING(Model::TerminalSettings, double, Opacity, UseAcrylic() ? 0.5 : 1.0);
         INHERITABLE_SETTING(Model::TerminalSettings, hstring, Padding, DEFAULT_PADDING);
diff --git a/src/cascadia/inc/ControlProperties.h b/src/cascadia/inc/ControlProperties.h
index 1d87cc57165..c18e70e7cb2 100644
--- a/src/cascadia/inc/ControlProperties.h
+++ b/src/cascadia/inc/ControlProperties.h
@@ -20,6 +20,7 @@
 #define CONTROL_APPEARANCE_SETTINGS(X)                                                                                                          \
     X(til::color, SelectionBackground, DEFAULT_FOREGROUND)                                                                                      \
     X(double, Opacity, 1.0)                                                                                                                     \
+    X(bool, UseAcrylic, false)                                                                                                                  \
     X(winrt::hstring, BackgroundImage)                                                                                                          \
     X(double, BackgroundImageOpacity, 1.0)                                                                                                      \
     X(winrt::Windows::UI::Xaml::Media::Stretch, BackgroundImageStretchMode, winrt::Windows::UI::Xaml::Media::Stretch::UniformToFill)            \
@@ -55,7 +56,7 @@
 #define CONTROL_SETTINGS(X)                                                                                                                              \
     X(winrt::hstring, ProfileName)                                                                                                                       \
     X(winrt::hstring, ProfileSource)                                                                                                                     \
-    X(bool, UseAcrylic, false)                                                                                                                           \
+    X(bool, EnableUnfocusedAcrylic, false)                                                                                                               \
     X(winrt::hstring, Padding, DEFAULT_PADDING)                                                                                                          \
     X(winrt::hstring, FontFace, L"Consolas")                                                                                                             \
     X(float, FontSize, DEFAULT_FONT_SIZE)                                                                                                                \


Test patch: