picom icon indicating copy to clipboard operation
picom copied to clipboard

Ignore blur for fully transparent windows

Open s0la opened this issue 4 years ago • 6 comments

Hi guys!

First of all, thank you all so much for the amazing work you have put into this, I really appreciate it! :)

Title really says it all.. I wish there is an option to ignore blur for fully transparent colors, for example: On the image below, you can see my lemonbar consists of three separate parts, and I achived that by setting background color to be fully transparent (#00 alpha), which works great, as I expected.. Problem is, when blur is enabled, the area between those tree visible sections is blured out, which I don't like.. I have same issue with rofi.. On the image you can see I set background color of main window (color between and around items) to be fully transparent, but when blur is enabled, background color (and also whole margin area - in this case all the space from the left monitor edge) is blured out, which, again, is not what I want..

I would like to keep blur for the rofi items though (hopefully you can see they are a tiny bit transparent), and also for some portions of lemonbar, which are not fully transparent..

picom3 I don't have blur currently enabled for the given reason, and also my current hardware unfortunately doesn't support it..

Hopefully my request is clear enough :)

current version: vgit-3ad4c

s0la avatar Dec 13 '20 00:12 s0la

@yshui Since rounded corners are going to need some form of "blur-clipping" (and shadow clipping FWIW) I wondered if we could render the shaped window into a stencil buffer based on the alpha-channel and use this to clip the rendered blur. Doing it this way should provide this feature basically for free (at least for the experimental backends) but would require a restructuring of the rendering pipeline.

tryone144 avatar Dec 18 '20 23:12 tryone144

@tryone144 basically what I am thinking too. still trying to find the best way to formulate this as an API though. we would need to support this in the xrender backend as well.

yshui avatar Dec 19 '20 00:12 yshui

Would it be possibel to just discard all pixels with a transparency of 0?

if (opacity < 0.0001)
  discard; // or mix with an unblurred background

This should let the window define any shape to be transparent, but it might not work with shadows (I don't know how those are implemented).

It might work as a solution for things such as Conky with a clear image as the background, or windows with rounded corners (like Rofi).

KiranWells avatar Jan 06 '21 17:01 KiranWells

I'm running into this same issue with oddly shaped windows in electron, using a transparent background #00000000 and opaque content. precisely like the above image, the pixels where the color is alpha 0 are still blurred, as they are within the window.

I see this is low priority, but are there any workarounds for this?

valyrie97 avatar Dec 28 '21 10:12 valyrie97

I'm having the same problem, hope to see an option for this.

snowmii avatar Mar 06 '23 13:03 snowmii

Specifically for lemonbar, I get around this by having multiple lemonbar processes run with different geometry values to get the gaps in between.

cab-1729 avatar Nov 26 '23 01:11 cab-1729