microsoft / terminal

The new Windows Terminal and the original Windows console host, all in the same place!
MIT License
95.05k stars 8.23k forks source link

Investigate: AcrylicBlur always on in an inactive window #7158

Closed harounhajem closed 1 year ago

harounhajem commented 4 years ago

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.

Jaswir commented 1 year ago

@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.

AbdullahAlmanei commented 1 year ago

@Jaswir Not currently, would love to see what you will do with it!

Jaswir commented 1 year ago

start_plumbing

MitchTalmadge commented 1 year ago

Amazing. Great work @Jaswir

Jaswir commented 1 year ago

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

MitchTalmadge commented 1 year ago

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:

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.

Jaswir commented 1 year ago

Hi Folks,

Thanks for the positive feedback. Thought I'd keep you in the loop and send an update on the progress. Did part of the plumbing and this is what I got so far.

plumbing_global_done_maybe_share_92

I am just a contributor for authority related stuff chat with @zadjii-msft

Jaswir commented 1 year ago

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.

@MrShortcut Making a cutout of the background what do you mean? I don't understand. I want to test whether this case is handled as well.

MrShortcut commented 1 year ago

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.

@MrShortcut Making a cutout of the background what do you mean? I don't understand. I want to test whether this case is handled as well.

Recortes as screenshot of your bg in the desktop

Jaswir commented 1 year ago

@MrShortcut

Recortes as screenshot of your bg in the desktop

??? Can you/someone show this with a gif or something please

MitchTalmadge commented 1 year ago

It's not a feature, @MrShortcut is making a suggestion of a hacky workaround for a fake "acrylic blur" (take a screenshot of your desktop, then blur it in e.g. Photoshop, and set it as a photo background). Not something you need to worry about. It was just a suggestion for a way to make the window still look blurred until the actual blur-while-inactive feature that you're working on was implemented.

Cellhawk commented 1 year ago

Hey people, user here... What about making an option to have the window go non-blur transparent when unfocused, instead of solid?

zadjii-msft commented 1 year ago

That is like, literally what this thread is about.

Cellhawk commented 1 year ago

That is like, literally what this thread is about.

As far as I am aware, the thread is about keeping the blur when unfocused. I am talking about switching from blur to no blur (clear transparent), when unfocused. That way, it would still fall into the system wide specifications, as (temporary) alternative.

Basically have an option for "When unfocused, switch background to:"

  1. Solid
  2. Transparent (without AcrylicBlur effect)
zadjii-msft commented 1 year ago

Good point! I mixed up the two threads. They've become so intertwined in my head that I forgot that we never de-duped them! That's what I get for triaging before having enough coffee.

The two have become entirely intertwined, and I forgot they didn't get merged. My b.

All together, that will allow the full matrix of (acrylic or vintage) x (some amount of transparancy) x (for a focused or unfocused terminal).

Sorry for the confusion!

MitchTalmadge commented 1 year ago

Hey people, user here... What about making an option to have the window go non-blur transparent when unfocused, instead of solid?

That's a good idea, maybe a nice way to implement it would be to add a third option, "transparent," to the two additional settings I proposed here: https://github.com/microsoft/terminal/issues/7158#issuecomment-1648326305

zadjii-msft commented 1 year ago

I mean, that's basically the same. Goal here is basically:

"profiles":
{
    "list":
    [
        {
            "commandline": "pwsh.exe",
            "name": "A",
            "unfocusedAppearance":
            {
                "useAcrylic": false,
                "opacity": 100,
            },
            "useAcrylic": true,
            "opacity": 50,
        },
        {
            "commandline": "pwsh.exe",
            "name": "B",
            "unfocusedAppearance":
            {
                "useAcrylic": true,
                "opacity": 50,
            },
            "useAcrylic": true,
            "opacity": 50,
        },
        {
            "commandline": "pwsh.exe",
            "name": "C",
            "unfocusedAppearance":
            {
                "useAcrylic": true,
                "opacity": 50,
            },
            "useAcrylic": false,
            "opacity": 100,
        },
        {
            "commandline": "pwsh.exe",
            "name": "D",
            "unfocusedAppearance":
            {
                "useAcrylic": true,
                "opacity": 0,
            },
            "useAcrylic": false,
            "opacity": 0,
        },
    ]
}

Or literally any other permutation.

MitchTalmadge commented 1 year ago

That looks fantastic. I love that configuration scheme.

MrShortcut commented 1 year ago

It's not a feature, @MrShortcut is making a suggestion of a hacky workaround for a fake "acrylic blur" (take a screenshot of your desktop, then blur it in e.g. Photoshop, and set it as a photo background). Not something you need to worry about. It was just a suggestion for a way to make the window still look blurred until the actual blur-while-inactive feature that you're working on was implemented.

exactly the alternative solution for me, use the powershell in full screen (ALT+ENTER), focus the terminal, take screenshot, save the screenshot, and use the screenshot as background in powershell, hacky method while the main feature unfocusedAcrilicBlur is ready an deployed.

Jaswir commented 1 year ago

@0x7c13

So are you like the actual inventor of Notepad ??? :O

Jaswir commented 1 year ago

Update: the plumbing is going well!

MrShortcut commented 1 year ago

with the hacky method my powershell looks like this image

Jaswir commented 1 year ago

Got the plumbing done and working now AFAIK! Ofcourse, you'll only see it working when I apply/implement THATfunctionality and send a gif of that :D

Jaswir commented 1 year ago

Thought I'd send you an update.

Acrylic focused, non acrylic unfocused: acrylic_foc_transparent_unfo2

image

Functionality for different acrylic in focused and unfocused is there, code really ugly though ;) (also some bugs probably).

Jaswir commented 1 year ago

image

A hero was born 😎

It took a while but they say if you’re patient you’ll be rewarded. Funny thing is I am not patient at all.

Anyway after 3 years there you go ;)

PS: 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. The other part of this PR I will cover in 11092

Jaswir commented 1 year ago

So there's 2 brushes to make the terminal Acrylic: Backdrop and HostBackDrop. The Backdrop brush is used to make the unfocused terminal have Acrylic.

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.

mpusch88 commented 1 year ago

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!

Jaswir commented 1 year ago

A: has HostBackdrop for focused and Backdrop to make unfocused Acrylic work edgecase_backdrop_acrylic

Jaswir commented 1 year ago

B: has Backdrop for focused and unfocused edgecase_backdrop_acrylic_option_old

Jaswir commented 1 year ago

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

ADPenrose commented 1 year ago

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?

Jaswir commented 1 year ago

@ADPenrose

You can always git clone the developer version from here: https://github.com/microsoft/terminal And build and run it using the READMe.md. If you really wanna try it out.

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 .

vlxjack commented 1 year ago

Amazing! Thank you! Great Work!

Jaswir commented 1 year ago

For updates on allowing opacity to be set differently in both focused and unfocused terminals. I suggest subscribing to: https://github.com/microsoft/terminal/issues/11092

Jaswir commented 12 months ago

@ADPenrose Guess what's going to be released today! : https://github.com/microsoft/terminal/releases

ADPenrose commented 12 months ago

@Jaswir You just made my day haha! Thanks a lot c:

schm1dtxbox commented 8 months ago

@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)