esjeon / kwin-forceblur

Force-enable blur effect to user-specified windows
MIT License
157 stars 7 forks source link

Spotify blur effect is not re-applied when the application is restarted #11

Open ihsanauliaa opened 4 years ago

ihsanauliaa commented 4 years ago

Hello, before all, thank you for your work!

I have successfully applied the force blur for Spotify. Unfortunately, I noticed that the effect is not reapplied when Spotify is restarted. Is there any workaround for this issue?

Thanks!

Edit: I think it is only happening with Spotify. I tried with Slack and it reapplied the effect just fine.

esjeon commented 4 years ago

Hmm, how did you make Spotify transparent? AFAIK, it doesn't natively support background transparency. If you used KWin window rules to apply transparency, it's possible that the rules are not correctly set.

If the problem persists, you can check if the script is working or not by checking window properties. Run xprop _KDE_NET_WM_BLUR_BEHIND_REGION in Konsole, and click the window of your interest. It should show something.

ihsanauliaa commented 4 years ago

Yeah I used KWin window rule and unchecked and checked the option to enable Force blur script and it works when the application is running, but it is not reapplied when I restarted spotify.

When I run xprop _KDE_NET_WM_BLUR_BEHIND_REGION after I uncheked and checked the option to enable force blur, it detected the blur properties (0, 0, 1602, 933) but when I restarted spotify, it said that it is not found.

I observed that when I launched spotify for the first time, its window size kind of flickered (the window started small, and then it resized to its proper size, probably beacuse it is loading something?). Maybe force blur doesn't detect the window because of it? I don't really know though.

Other electron apps worked just fine when I restarted them.

esjeon commented 4 years ago

I've just reproduced the bug on my environment. A weird thing is that the Spotify window has no "class" on startup. At least, that's what debug prints are saying. It's possible that window class and hints are added manually after creating the window.

I tried some quick workarounds, which didn't work. It may take some time.

ihsanauliaa commented 4 years ago

So that's the problem! If that's the case then that's unfortunate.

Thank you anyway!

RitwickVerma commented 4 years ago

A workaround is to leave a blank line in the list of window class names.

ihsanauliaa commented 4 years ago

@RitwickVerma can you elaborate? How can I leave a blank line in the list of window class names? Through settings?

RitwickVerma commented 4 years ago

Yes. There should be a configure button next to the effect in kwin settings. image

Here's what my list looks like. image

ihsanauliaa commented 4 years ago

It does work! Thank you! I didn't realize that blank line is a valid window class name

esjeon commented 4 years ago

@RitwickVerma So, because the class name is initially empty, you just chose to match the empty class name. lol. That's brilliant.

Btw, I'll leave this ticket open, until it's properly solved.

RitwickVerma commented 4 years ago

haha yeah tbh I didnt expect it to work.

diogofd8 commented 2 years ago

@RitwickVerma @esjeon What is the solution for when you mark "blur all except matching"? I wanted to avoid manually naming everything I want to blur but apparently even with an empty exceptions list it fails to blur spotify.