blur-my-shell icon indicating copy to clipboard operation
blur-my-shell copied to clipboard

Curved blur effects

Open spxak1 opened this issue 5 years ago • 33 comments

The blur effect has a rectangular shape rather than the curved edges of the Dock and/or panel (as set by themes/shells). Is this something that can be fixed so that the effect follows the shape of those items?

Thank you.

spxak1 avatar Oct 26 '20 01:10 spxak1

Yes, I noticed this some times ago but I forgot to include that!

There is currently no (easy) way to include non-rectangular shape... I could try to draw the corners by hand, with a lot of little rectangles but this seems very hard to do

So I guess this too needs to be fixed in gnome! Sorry for that :(

aunetx avatar Oct 26 '20 08:10 aunetx

Thanks for your response. Doing it by hand is too much and rather pointless as the radius is also different depending on what other extensions people use (I, for one, don't use dash-to-dock but the floating-dock fork that offers control of the radius). So we will wait for gnome. Thanks.

spxak1 avatar Oct 26 '20 12:10 spxak1

OK I see how much perturbing this is actually :/

I will open an issue on gitlab for this too, but I can't really push more than that ftm :(

aunetx avatar Oct 26 '20 13:10 aunetx

KDE has this same issue and no one seems to want to fix it. I feel we should maybe try to write a script that draws those little rectangles for us by following the path of the object. Do you think this is possible @aunetx?

andrewaclear avatar Mar 03 '21 08:03 andrewaclear

Sorry for responding very late @andrewaclear :/ Honestly, I don't think this will be possible at our level... It would mean having hundreds of blurred actors, and keeping them in sync with a selected object's shape; this is clearly either very hard to achieve, or very cpu-hungry

aunetx avatar Apr 21 '21 15:04 aunetx

Oh it's ok don't worry @aunetx. Ya, I'm still new to a lot do this stuff so I'm trying to learn. I wanna try to think of a way somehow though because linux should become the best OS and these are the areas that are still putting it inferior to Mac for instance.

andrewaclear avatar Apr 21 '21 16:04 andrewaclear

Maybe the best way would be to make/modify to get a really nice theme and then set the corners and everything to work properly with that theme. I mean at the end of the day there's no point in trying to make an ugly theme look good.

andrewaclear avatar Apr 21 '21 16:04 andrewaclear

I have a few ideas on how to round the blur as a part of #39 . Just referencing it here to keep track

CorvetteCole avatar Apr 22 '21 06:04 CorvetteCole

Ok sick. Hey dude, you're the one that was working on blur-provider. That's really cool. Ya I'm totally down to help you guys. I'm a CS student so I'm still learning stuff but if you guys can lead me in the right direction that would be awesome. I have already done some theme designing in linux and really want to help bring it to the next level. Linux is the best but it needs this last push.

andrewaclear avatar Apr 23 '21 05:04 andrewaclear

yep! blur-provider was my baby. I was pretty much the first to build a blur extension and the shell blur was so buggy I just gave up. But, I think this extension has some great stuff and this will be a good addition to it. In terms of learning, I would start by taking a look at https://gjs.guide. I can find more resources later just ping me! I am a Computer Engineering student personally :)

CorvetteCole avatar Apr 23 '21 15:04 CorvetteCole

Oh sweet. Ya for sure. Oh thanks I'll check that. Nice to meet you @CorvetteCole and also @aunetx I'm Andrew.

andrewaclear avatar Apr 23 '21 21:04 andrewaclear

Nice to meet you too @andrewaclear, glad you're interested in this extension :)

aunetx avatar Apr 24 '21 08:04 aunetx

@CorvetteCole how did blur-provider deal with rounded corners?

Project-Magenta avatar Apr 27 '21 19:04 Project-Magenta

@Project-Magenta it kind of... didn't. That was one of the things I wanted to solve. I sort of abandoned blur-provider development because there were many shell bugs and it was insanely infuriating. I am back at it, and glad to not be the only one working on it this time. So... blur-provider is kind of being entirely rewritten for the inclusion in to this extension

CorvetteCole avatar Apr 28 '21 06:04 CorvetteCole

Huh? then why it work with round corners my theme

Project-Magenta avatar Apr 28 '21 14:04 Project-Magenta

@Project-Magenta well, it still creates a box. so it may look alright at a glance but in reality there are sharp corners still for the blur

CorvetteCole avatar Apr 28 '21 15:04 CorvetteCole

Wouldn't it be better to have this disabled by default? Since it's currently broken and it looks bad

IsraPerez98 avatar Jun 16 '22 22:06 IsraPerez98

I've just had an idea, but take my words with a grain of salt because I'm not an extension developer to this extent. From what I understand, the blur my shell extension adds a sort of layer behind the things it blurs. So what if we make this layer span the entire screen, then use a mask in the shape of the dock to provide blur behind it? That would allow rounded corners, notification blurring, and get rid of some flickering when a high contrast color touches the edge of a blurred element. Blur-Conecept Something like this where the black parts would be the blur layer. I suppose that doing this would cause the same issue as drawing the blur layer though, where you can't just make rounded corners without drawing tiny rectangles by hand. Let me know what you think about this!

Kyanoxia avatar Jul 07 '22 22:07 Kyanoxia

@Zany-Zachary1 this is a good idea in general, the issue is with stacking windows. how do we deal with a blurred window partially on top of another window? or, even worse, a blurred window overlapping ANOTHER blurred window. Static blur is an option already for the panel as an example of this. This is a particularly big problem for blurring notifications, since they are likely to pop up over windows and would look funny if they instead showed the desktop background

CorvetteCole avatar Jul 08 '22 13:07 CorvetteCole

Assuming that the masked blur is always live, I suppose we could have different layers. That would be quite performance heavy though. This would however work for the dock assuming no other windows are blurred behind it. I think this would be a good idea to implement with a toggle for multiple layers.

Kyanoxia avatar Jul 08 '22 17:07 Kyanoxia

I don't think it's worth spending our time on it, since if we can solve the big problem that fixes ALL cases, that would be far better than a bandaid. That said, I'm sure neither @aunetx or I would be opposed to reviewing a pull request implementing this if you'd like to give it a shot!

CorvetteCole avatar Jul 08 '22 18:07 CorvetteCole

Well, if I were good as Aunetx, I totally would. I've only ever made simple extensions, but if anyone else would like to do this, that would be great.

Kyanoxia avatar Jul 08 '22 18:07 Kyanoxia

No time like the present to learn! We can always use contributors. I went from 0 to being an extensions.gnome.org reviewer relatively quickly. Check out https://gjs.guide/, and join the IRC or Matrix for Gnome Extensions at https://matrix.to/#/#gnome:gnome.org or irc://irc.gnome.org/shell-extensions

CorvetteCole avatar Jul 08 '22 18:07 CorvetteCole

Sorry, I'm very busy and can't help you a lot... This is a good idea, unfortunately from what I've tried, this does not work -- at least not as easily as I would like.

In #265 I tried to use an effect in order to mask the corners of widgets ; you can easily try it out. Unfortunately I've still not found a way to put it on top of the blur effect with backdrop mode.

So if you find a way to do it (even if we need to re-implement the whole blur effect) this can be very great (and there is not need to have only one layer btw, as we can have the blur effect the same size as the widget, and then just mask the corners -- as with the idea in #265). But I'm not sure how to do it, and idk if it is worth the time ; maybe an upstream implementation would be better...

aunetx avatar Jul 08 '22 18:07 aunetx

Just recently Firefox finally implemented blur-backdrop. Can this be helpful since I believe gnome shell was built off of Mozilla back on the day? Idk if there is any relation anymore.

andrewaclear avatar Aug 05 '22 22:08 andrewaclear

@Zany-Zachary1 This does sound like a smart potential approach but I guess like you guys were saying we still have the overlapping issue and inefficiency if we just make an entire layer for each. I wonder if Windows might have encountered this as you'll notice that windows that are blurred (like the settings for instance) are only blurred when focused. I'm not saying I like this solution though. It's kinda lame.

andrewaclear avatar Aug 05 '22 22:08 andrewaclear

I think implementing border radius into gnome shell's blur option would be most resource efficient and the best solution. Really all we need is border radius and doing some hack in the front end will always be subpar and resource heavy.

andrewaclear avatar Aug 05 '22 22:08 andrewaclear

Currently working on a proof of concept using COGL to render a custom path (https://developer-old.gnome.org/clutter-cookbook/stable/actors-non-rectangular.html). Would need to override the paint function of the Actor. Will update after I test this

Adding Desktop Cube code as reference for me: https://github.com/Schneegans/Desktop-Cube/blob/main/src/Skybox.js#L141

CorvetteCole avatar Feb 13 '23 16:02 CorvetteCole

That's very promising, update us please if anything works

hrqmonteiro avatar Apr 27 '23 21:04 hrqmonteiro

I think implementing border radius into gnome shell's blur option would be most resource efficient and the best solution. Really all we need is border radius and doing some hack in the front end will always be subpar and resource heavy.

Is there any upstream feature request that already tracks this? Maybe the Gnome devs just don't know that this is a much wanted feature by the theming community?

major-mayer avatar Nov 13 '23 16:11 major-mayer