picom: add scale animation for size changes in geometry trigger

When both size AND position change (common in tiling WMs), picom's
win_position_changed() returns false. Only size_changed is true.
This means the geometry trigger fires but only scale-x/y change,
not offset-x/y.

Added scale-x and scale-y with spring physics to the geometry
animation so windows animate properly when resized.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-02 13:10:33 -08:00
parent 8bce7b05c6
commit daf2911540

View File

@@ -127,6 +127,8 @@ makeEnable config "myModules.xmonad" true {
# Set clamping to false for bounce/overshoot effects
animations = (
# Window move/resize animation with spring physics
# Note: "geometry" is alias for "size" + "position" triggers
# position_changed is FALSE if size also changed, so we need scale-x/y too
{
triggers = ["geometry"];
offset-x = {
@@ -139,6 +141,16 @@ makeEnable config "myModules.xmonad" true {
start = "window-y-before - window-y";
end = 0;
};
scale-x = {
curve = "spring(250, 20, 1, false)";
start = "window-width-before / window-width";
end = 1;
};
scale-y = {
curve = "spring(250, 20, 1, false)";
start = "window-height-before / window-height";
end = 1;
};
},
# Opacity fade animation
{