uebersicht icon indicating copy to clipboard operation
uebersicht copied to clipboard

Backdrop filter 'blinks' when moving through spaces

Open markoradak opened this issue 8 years ago • 13 comments

Just as title says - anything with any backdrop filter on it (blur, saturate, grayscale etc.) blinks when switching spaces. It doesn't happen every time though, and it is completely random. When it occurs, you can see everything else regularly - except the backdrop filter, which kicks in a few moments later - making the widget 'blink'.

Tested on iMac (late 2013) and Macbook Air (late 2012).

I can post short screencast in case I haven't made myself clear 😄

Amazing app, btw!

markoradak avatar Apr 19 '16 23:04 markoradak

On that note - wouldn't it make sense to use native vibrancy (via NSVisualEffectView) instead? And create some simple API for it - allowing to set it up within the widgets script when needed.

markoradak avatar Apr 19 '16 23:04 markoradak

It is actually a workaround to make background filters update when switching spaces. If they are not forced to redraw, they'll keep showing pixels from the previous space (noticeable when you have different wallpapers per space). The force redraw is what causes the flickering. Unfortunately I have not found another solution yet that doesn't flicker.

Regarding your suggestion using a NSVisualEffectView: I could picture some JS api using the scripting bridge that would allow you to set up a NSVisualEffectView. It would be behind the main Übersicht WebView and the api would allow you to size and position it. Is this something like what you had in mind?

felixhageloh avatar Apr 20 '16 15:04 felixhageloh

Yeah, that makes a lot of sense. Is there an option to disable force redraw though? As I imagine it would fix the issue, at least if there are no different wallpapers of course...

As for NSVisualEffectView - yes, exactly what I had in mind.

markoradak avatar Apr 20 '16 18:04 markoradak

(Sorry for the late reply - it's been a busy week)

So, there is no option to disable the force redraw at the moment. I also couldn't think of any way of hacking around it without changing the code. FYI, I'm currently emitting a custom dom event onwallpaperchange and I react to it like this:

window.addEventListener 'onwallpaperchange', ->
  # force a redraw of backdrop filters
  contentEl.style.transform = 'translateZ(1px)'
  requestAnimationFrame -> contentEl.style.transform = ''

I'm currently working hard on getting the next release out (ES6, CommonJS and a virtual DOM, like React). I will see if I can squeeze in some time to find a solution that has no flickering (maybe using your NSVisualEffectView suggestion)

felixhageloh avatar Apr 25 '16 11:04 felixhageloh

Gotcha! It would definitely be nice :) Kudos for working on a new rewrite as well - definitely looking forward to it!

markoradak avatar Apr 26 '16 14:04 markoradak

Wonder where you're at with this refresh thing... It's too annoying right now to use the filters. Hope you'll find a way !

bitsandnumbers avatar Jan 10 '17 19:01 bitsandnumbers

no progress yet unfortunately

felixhageloh avatar Jan 18 '17 08:01 felixhageloh

I put some effort into this issue and created a small CLT that creates a blurred window using NSVisualEffectView.

In order to prevent blinking I had to use some sketchy stuff, because when using only one window per screen with .canJoinAllSpaces you will still see a blinking effect if your spaces use different desktop images. To avoid this I used some private CoreGraphics APIs to create a separate windows for each space.

At the moment I start my tool after login, maybe we could add this to Übersicht in some way in the future.

Also note that this is still in early development.

kinglouie avatar Mar 27 '18 16:03 kinglouie

@kinglouie thanks for the info! So it seems like this issues exists even when you use NSVisualEffectView directly?

felixhageloh avatar Apr 09 '18 13:04 felixhageloh

Correct, the issue isn't as severe as the backdrop issue, but it is annoying nontheless. As with the backdrop filter the blurred background will dissappear for a short period of time, with NSVisualEffectView it doesn't disappear but you will still see the blurred background from the last desktop wallpaper for a short period.

kinglouie avatar Apr 09 '18 13:04 kinglouie

The blinking is actually caused by Übersicht. It is forcing the backdrop to redraw, otherwise you would get what you described and worse, because the blurred background sometimes wouldn't redraw at all.

felixhageloh avatar Apr 09 '18 18:04 felixhageloh

@felixhageloh wanting to check if a solution has been found for this. thanks!

lcsbckls avatar Feb 28 '22 22:02 lcsbckls

the only solution to this would be to create a separate window for every space and since übersicht is a browserwindow this wouln't be very good performance wise. An alternative to creating multiple browserwindows would be creating some native windows with the backdrop for every space just as I demonstrated in earlier comments. I don't know if my tool still compiles because I dont use macOS anymore but with my tool I got a nice looking solution without any graphical issues.

kinglouie avatar Mar 01 '22 07:03 kinglouie