Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blur doesnt work with dynamic wallpaper apps #395

Closed
FormalSnake opened this issue Sep 5, 2023 · 22 comments
Closed

Blur doesnt work with dynamic wallpaper apps #395

FormalSnake opened this issue Sep 5, 2023 · 22 comments
Labels
incompatibility Problems that arise by using other third party software in combination with sketchybar

Comments

@FormalSnake
Copy link

Screenshot 2023-09-05 at 10 12 15 Screenshot 2023-09-05 at 10 13 17

It basically keeps flickering between transparent and non transparent.

@FormalSnake
Copy link
Author

And when I try to record it it works fine lmao, I stop recording and it bugs out again

@FelixKratz
Copy link
Owner

Could you explain it a bit more wordy? I think I dont understand what exactly the problem is. Does the bars background stay and the content disappears or does the entire bar become invisible?

It seems this dynamic wallpaper app is doing something strange, maybe it is because of the window ordering. It could be that sketchybar and your dynamic wallpaper are figthing for the window level, could you try:

sketchybar --bar topmost=window

@FormalSnake
Copy link
Author

so basically, the bar starts flickering with being translucent or not, and when I executed the command you provided me, the bar bugs out a lot less now

@FelixKratz
Copy link
Owner

FelixKratz commented Sep 5, 2023

So it disappears completely and then reappears? I think it must be because of the wallpaper app doing some window ordering that they should not be doing...
Could you quantify "a lot less"? Once a second or once a minute or never?
you could try

sketchybar --bar topmost=on

this makes sketchybar the topmost overall window and nothing should be able to draw over it (not even the macOS bar).

I think this is not something I can address in sketchybar, it has to do with how this wallpaper app orders itself and other apps I think.

@FormalSnake
Copy link
Author

Screenshot 2023-09-05 at 10 12 06

It doesnt appear on screenshots, but you can see the background of the bar is translucent and has blur, but it keeps changing to it having a solid background. The background appears solid because it does not seem to see the wallpaper behind it.

@FormalSnake
Copy link
Author

and it is very inconsistent between timing, sometimes a minute, sometimes seconds, etc.

@FormalSnake
Copy link
Author

no other app has this issue, for example iTerm or Arc's background blur look correct with the moving wallpaper

@FormalSnake
Copy link
Author

Screen.Recording.2023-09-05.at.10.40.24.mov

and it does not bug out when recording.

@FelixKratz
Copy link
Owner

Does it look like this: koekeishiya/yabai#1665 ?

@FormalSnake
Copy link
Author

It looks similar to the second one they show

@FelixKratz FelixKratz changed the title Doesnt work with iWallpaper (MyWallpaper) dynamic wallpapers Transparency doesnt work with dynamic wallpapers Sep 5, 2023
@FelixKratz
Copy link
Owner

FelixKratz commented Sep 5, 2023

It is probably the same problem, it has to do with the transparency and blur and is a side effect of
using SLSSetWindowBackgroundBlurRadius instead of a CABackdropLayer.

You could simply disable transparency and blur to fix the problem.

@FormalSnake
Copy link
Author

I could but it would not look nearly as good tho. Could the app still work if you use CABackdropLayer instead? what are the disadvantages?

@FelixKratz FelixKratz added the incompatibility Problems that arise by using other third party software in combination with sketchybar label Sep 5, 2023
@FelixKratz
Copy link
Owner

The problem is that we are using the CGContext of the window to draw all contents, using a CABackdropLayer would include creating a window surface on which this backdrop layer is drawn. Unfortunately, the CGContext is below all surfaces of the window such that the entire drawing had to be done in surfaces with CALayers that would order above the backdrop layer. This is a problem, because I can not draw with the CGContext* functions into a CALayer and the entire drawing logic had to be redone with CALayers.
If it was possible to order the surfaces below the CGContext then this would be no problem, but I have not found a way to do that.

So you see it is not impossible, but not feasible for me to do.

@FormalSnake
Copy link
Author

Well, someone might come across this issue who is willing to fix this someday. For now I will not use the wallpaper app.

@FelixKratz
Copy link
Owner

There is one thing you could try:
Replace all occurrences of SLSSetWindowBackgroundBlurRadius with
SLSSetWindowBackgroundBlurRadiusWithOpacityHint and compile and run the program. It might not do anything, but it is worth a try.

@FelixKratz FelixKratz changed the title Transparency doesnt work with dynamic wallpapers Transparency doesnt work with dynamic wallpaper apps Sep 5, 2023
@FormalSnake
Copy link
Author

sure, this will be my first time compiling C tho, so I might require assistance later

@FormalSnake
Copy link
Author

I compiled it succesfully but how do I run it?

@FelixKratz
Copy link
Owner

If you are in the sketchybar source code folder with your terminal just run:

brew services stop sketchybar
./bin/sketchybar

This stops the brew version of sketchybar and starts the one compiled from source with your changes.

Btw, does the bugging occur when setting:

sketchybar --bar blur_radius=0

@FormalSnake
Copy link
Author

the bugging stops when I do blur_radius=0

@FelixKratz FelixKratz changed the title Transparency doesnt work with dynamic wallpaper apps Blur doesnt work with dynamic wallpaper apps Sep 5, 2023
@FelixKratz
Copy link
Owner

the bugging stops when I do blur_radius=0

Ah thats interesting, so it really is only the blur that causes this...

@FormalSnake
Copy link
Author

```shell
./bin/sketchybar

After doing this part, the bugging still occurs

@FormalSnake
Copy link
Author

the SLSSetWindowBackgroundBlurRadiusWithOpacityHint

@FelixKratz FelixKratz closed this as not planned Won't fix, can't repro, duplicate, stale Sep 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatibility Problems that arise by using other third party software in combination with sketchybar
Projects
None yet
Development

No branches or pull requests

2 participants