yshui / picom

A lightweight compositor for X11 with animation support
https://picom.app/
Other
4.15k stars 589 forks source link

Picom black strange corners #997

Open lukiiimohh opened 1 year ago

lukiiimohh commented 1 year ago

Platform

Arch Linux

GPU, drivers, and screen setup

VMWare Drivers

Environment

I use kitty, firefox-gnome-theme, and bspwm

picom version

vgit-ce46b

Diagnostic

**Version:** vgit-ce46b

### Extensions:

* Shape: Yes
* XRandR: Yes
* Present: Present

### Misc:

* Config file used: /home/luk/.config/picom/picom.conf

### Backend: glx

* Driver vendors:
 * GLX: Mesa Project and SGI
 * GL: Mesa/X.org
* GL renderer: llvmpipe (LLVM 14.0.6, 256 bits)
* Accelerated: 0

(You are using a software renderer. Unless you are doing this
intentionally, this means you don't have a graphics driver
properly installed. Performance will suffer. Please fix this
before reporting your issue.)

### Backend: egl

libEGL warning: DRI2: failed to authenticate
[ 01/14/23 12:18:25.133 egl_init ERROR ] EGL_KHR_image_pixmap not available.
 Cannot initialize this backend

Configuration:

shadow = true;

shadow-radius = 10;
shadow-offset-x = -10;
shadow-offset-y = -10;
shadow-opacity = 0.6;
shadow-red = 0.0;
shadow-green = 0.0;
shadow-blue = 0.0;

shadow-exclude = [
                    "class_g = 'Polydock'",        
                     "name = 'stalonetray'",
                     "name = 'polybar'",
                     "name = 'plank'",
                     "name = 'Notification'",
                     "name = 'fluxbox'",
                     "class_g = 'bspwm'",
                     "class_i = 'presel_feedback'",
                     "class_g = 'fluxbox'",
                     "class_g ?= 'Notify-osd'",
                     "class_g = 'xfce4-panel'",
                     "class_i = 'POWERPNT.EXE'",
                     "class_i = 'WINWORD.EXE'",
                     "class_i = 'Meteo'"
                  ];

transition = true;
transition-offset = 25;
transition-direction = "smart-x";
transition-timing-function = "ease-out-cubic";
transition-step = 0.028;
transition-rule = [];
fading = true;
fade-delta = 4;
fade-in-step = 0.05;
fade-out-step = 0.05;
shadow-ignore-shaped = false;
inactive-opacity = 1.0;
active-opacity = 1.0;
frame-opacity = 1.0;
inactive-opacity-override = false;
wm-ignore = true;

wintypes :
{
    popup_menu =
    {
        opacity = 1.0;
    };
    dropdown_menu =
    {
        opacity = 1.0
    };
    dnd =
    {
        shadow = false;
    };
    dock =
    {
        shadow = true;
    };
    tooltip =
    {
        fade = true;
        shadow = true;
        opacity = 0.5;
        focus = true;
    };
};

corner-radius = 6;
rounded-corners-exclude = [
  "class_g = 'Polybar'",
]

Expected behavior

This type of corners image

Current Behavior

Works only in kitty, firefox is not working see this image. (I put 100 on rounded corners just for you to see what's happening) 2023-01-14_12h16_35

Other details

Only happens in firefox

absolutelynothelix commented 1 year ago

it's an issue with the xrender backend. you may try the glx one but it probably won't work well in the vm.

lukiiimohh commented 1 year ago

What's the parameter for calling glx instead of xrender, for example 'rounded-corners: ' I suppose it is 'backend: glx'?

absolutelynothelix commented 1 year ago

backend = "glx"; in the configuration file or --backend=glx in the command line arguments.

absolutelynothelix commented 1 year ago

@yshui, an insight for you: this is the same issue as #342 when we're adding transparent parts to a non-transparent window (that has 24-bit depth). the fix for the #342 is very specific so i can't easily expand it to cover this issue. maybe you will think of a way to fix this gracefully. here is the related code: https://github.com/yshui/picom/blob/23a29470e50ef1d68b9c99186b069659a793184c/src/backend/backend.c#L435-L483

lukiiimohh commented 1 year ago

Literally that backend crashed my entire system, I needed tty to restablish the file of picom.conf. So, obviously that is not working

yshui commented 1 year ago

duplicate of #808 ?

lukiiimohh commented 1 year ago

no, because in my case everything works well except the black corners ONLY in firefox

yshui commented 1 year ago

i think we just forgot to enable alpha blending in some cases, maybe for windows with 24-bit visuals.

absolutelynothelix commented 1 year ago

duplicate of #808 ?

i don’t think so.

tryone144 commented 1 year ago

@absolutelynothelix The fix for #342 is here: https://github.com/yshui/picom/pull/650 :wink:

I agree that this is most likely an issue with 24-bit visuals (as it only happens to some windows). Can we reuse decouple_image() when applying the rounded corners to enforce a 32-bit visual?

lukiiimohh commented 1 year ago

So I can do something to solve it, or just wait for you guys!?

absolutelynothelix commented 1 year ago

@tryone144, ikr. i saw the decouple_image function and the comment inside, i've just traced the logic to the beginning (the snippet i've provided). the problem is that decouple_image is not a publicly available backend operation and it's only used when doing the IMAGE_OP_APPLY_ALPHA operation so i can't think of an elegant fix for this issue. in theory, you may do the IMAGE_OP_APPLY_ALPHA operation without changing opacity so it will just force the pixmap to have 32-bit depth, but it's more a hack rather than a proper fix.

So I can do something to solve it, or just wait for you guys!?

unfortunately, no. it's the xrender backend's issue, glx backend doesn't work for you and egl won't work at all (according to the provided diagnostic information).

tryone144 commented 1 year ago

i think we just forgot to enable alpha blending in some cases, maybe for windows with 24-bit visuals.

@yshui pretty close. We reused a potentially only 24-bit visual for the temporary picture to which we applied the rounded-corners mask. This made them obviously not transparent. :smile:

@absolutelynothelix no need for such a big change. :wink: Since we already create a temporary picture, we can just force it to a 32-bit visual.

Fixed in https://github.com/yshui/picom/pull/1003

lukiiimohh commented 1 year ago

So, then, notify me when it is fixed, thanks for the work, keep up guys!