picom icon indicating copy to clipboard operation
picom copied to clipboard

Geometry animation differs for shadow and window

Open joaopauloalbq opened this issue 1 year ago • 1 comments

Platform

Manjaro 24.1 amd64

GPU, drivers, and screen setup

Intel UHD Graphics 620, mesa 24.2.4, xf96-video-intel 2.99.917+923+gb74b67f0, one laptop screen

glxinfo output
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) UHD Graphics 620 (KBL GT2) (0x5917)
    Version: 24.2.4
    Accelerated: yes
    Video memory: 3913MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.2.4-arch1.0.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.2.4-arch1.0.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.2.4-arch1.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

Awesome WM

picom version

v12.3 (/startdir/picom revision 081510a)

Diagnostics

Version: v12.3 (/startdir/picom revision 081510a)

Extensions:

  • Shape: Yes
  • RandR: Yes
  • Present: Present

Misc:

  • Use Overlay: No (Another compositor is already running)
  • Config file specified: None
  • Config file used: /home/jp/.config/picom/picom.conf

Drivers (inaccurate):

modesetting

Backend: glx

  • Driver vendors:
  • GLX: Mesa Project and SGI
  • GL: Intel
  • GL renderer: Mesa Intel(R) UHD Graphics 620 (KBL GT2)
  • Accelerated: 1 [ 12/11/2024 21:27:54.121 egl_init WARN ] The egl backend is still experimental, use with care.

Backend: egl

  • Driver vendors:
  • EGL: Mesa Project
  • EGL driver: iris
  • GL: Intel
  • GL renderer: Mesa Intel(R) UHD Graphics 620 (KBL GT2)

Configuration:

Configuration file
backend = "glx"
corner-radius = 20
shadow = true
shadow-opacity = 0.90

animations = (
    {
        triggers = [ "geometry" ];
        scale-x = {
            curve = "cubic-bezier(0.07, 0.65, 0, 1)";
            duration = 3.0;
            start = "window-width-before / window-width";
            end = 1;
        };
        scale-y = {
            curve = "cubic-bezier(0.07, 0.65, 0, 1)";
            duration = 3.0;
            start = "window-height-before / window-height";
            end = 1;
        };
        shadow-scale-x = "scale-x";
        shadow-scale-y = "scale-y";
        offset-x = {
            curve = "cubic-bezier(0.07, 0.65, 0, 1)";
            duration = 3.0;
            start = "window-x-before - window-x";
            end = 0;
        };
        offset-y = {
            curve = "cubic-bezier(0.07, 0.65, 0, 1)";
            duration = 3.0;
            start = "window-y-before - window-y";
            end = 0;
        };
        shadow-offset-x = "offset-x";
        shadow-offset-y = "offset-y";
        saved-image-blend = 0;
    }
);

Steps of reproduction

  1. Set corner-radius
  2. Set shadow
  3. Set animation for geometry change
  4. Resize the window

(1) Expected behavior

The shadow animation should have the same timing as the window animation.

(1) Current Behavior

The shadow animation is delayed compared to the window animation.


(2) Expected behavior

Corners should not erase shadows.

(2) Current Behavior

Corners are erasing the shadows. Corner shadows are being animated (?)


OpenGL trace

picom.trace.zip

Other details

https://github.com/user-attachments/assets/e2b0a090-5e63-4dab-adb0-e060d1b2b3d0

joaopauloalbq avatar Nov 13 '24 02:11 joaopauloalbq

hmm, i think this is probably because of interaction between saved-image-blend and rounded corners :thinking:

yshui avatar Nov 14 '24 15:11 yshui

so i think first of all, shadow has different width & height from its window (i.e. shadow_width = window_width + 2 * shadow_radius). so it does have to have a different scaling factor. and it's more noticeable if the window itself is small.

besides that, the corners do look wrong but unsure what's happening there.

yshui avatar Aug 20 '25 14:08 yshui

ok, i actually found the fix for the weird corners, but now i am baffled by the shadow detachment. it seems to only happen if the shadow offset is negative... so looks like my previous theory is wrong...

yshui avatar Aug 21 '25 05:08 yshui

yay \o/

joaopauloalbq avatar Aug 23 '25 15:08 joaopauloalbq