Skip to content

Commit 34ecca5

Browse files
committed
animation/presets: add geometry-change preset
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
1 parent 719f2a2 commit 34ecca5

File tree

4 files changed

+365
-3
lines changed

4 files changed

+365
-3
lines changed

assets/geometry-change.mp4

122 KB
Binary file not shown.

data/animation_presets.conf

+40-1
Original file line numberDiff line numberDiff line change
@@ -162,4 +162,43 @@ fly-in = {
162162
(2, "direction", [-1, 1, 0, 0]),
163163
(3, "direction", [0, 0, 1, 1]),
164164
);
165-
}
165+
};
166+
geometry-change = {
167+
scale-x = {
168+
curve = "cubic-bezier(0.07, 0.65, 0, 1)";
169+
duration = "placeholder0";
170+
start = "window-width-before / window-width";
171+
end = 1;
172+
};
173+
scale-y = {
174+
curve = "cubic-bezier(0.07, 0.65, 0, 1)";
175+
duration = "placeholder0";
176+
start = "window-height-before / window-height";
177+
end = 1;
178+
};
179+
shadow-scale-x = "scale-x";
180+
shadow-scale-y = "scale-y";
181+
offset-x = {
182+
curve = "cubic-bezier(0.07, 0.65, 0, 1)";
183+
duration = "placeholder0";
184+
start = "window-x-before - window-x";
185+
end = 0;
186+
};
187+
offset-y = {
188+
curve = "cubic-bezier(0.07, 0.65, 0, 1)";
189+
duration = "placeholder0";
190+
start = "window-y-before - window-y";
191+
end = 0;
192+
};
193+
saved-image-blend = {
194+
duration = "placeholder0";
195+
start = 1;
196+
end = 0;
197+
};
198+
shadow-offset-x = "offset-x";
199+
shadow-offset-y = "offset-y";
200+
*knobs = {
201+
duration = 0.4;
202+
};
203+
*placeholders = ((0, "duration"));
204+
};

man/picom.1.adoc

+20-2
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ animations = ({
515515

516516
_decrease-opacity_:: When the opacity of a window is decreased.
517517

518-
_geometry_:: When the geometry of a window is changed. (EXPERIMENTAL)
518+
[[trigger-geometry]]_geometry_:: When the geometry of a window is changed. (EXPERIMENTAL)
519519
+
520520
WARNING: The _geometry_ trigger is experimental. Using this means you accept the caveat that geometry animations will also trigger when you manually resize or move a window, like when you drag the window around with your mouse.
521521

@@ -598,6 +598,24 @@ endif::[]
598598

599599
_duration_:: Duration of the animation in seconds.
600600
--
601+
+
602+
_geometry-change_:::
603+
+
604+
Animate the geometry (i.e. size and position) change of the window.
605+
+
606+
WARNING: This makes use of both the <<trigger-geometry>> trigger, and the <<saved-image-blend>> output variable. Both of these features are experimental and may not work as expected.
607+
+
608+
--
609+
ifdef::env-web[]
610+
video::assets/geometry-change.mp4[width=400]
611+
endif::[]
612+
--
613+
+
614+
--
615+
*Options*:::
616+
617+
_duration_:: Duration of the animation in seconds.
618+
--
601619

602620
=== Advanced
603621

@@ -697,7 +715,7 @@ Currently, these output variables are supported: :::
697715

698716
_crop-x_, _crop-y_, _crop-width_, _crop-height_:: These four values combined defines a rectangle on the screen. The window and its shadow will be cropped to this rectangle. If not defined, the window and shadow will not be cropped.
699717

700-
_saved-image-blend_:: When the window's geometry changes, its content will often change drastically, creating a jarring discontinuity. This output variable allows you to blend the window's content before and after the geometry change, the before and after images will be stretched appropriately to match the animation. This way you can smoothly animated geometry changes. This is a number between 0 and 1. 0 means the saved image is not used, whereas 1 means you will only see the saved image. (EXPERIMENTAL)
718+
[[saved-image-blend]]_saved-image-blend_:: When the window's geometry changes, its content will often change drastically, creating a jarring discontinuity. This output variable allows you to blend the window's content before and after the geometry change, the before and after images will be stretched appropriately to match the animation. This way you can smoothly animated geometry changes. This is a number between 0 and 1. 0 means the saved image is not used, whereas 1 means you will only see the saved image. (EXPERIMENTAL)
701719
+
702720
WARNING: The _saved-image-blend_ variable is experimental. It might work incorrectly, cause visual artifacts, or slow down your system. You are welcome to open an issue on GitHub if you encounter any problems to help us improve it, though resolution is not guaranteed.
703721

0 commit comments

Comments
 (0)