Skip to content

Conversation

@lenemter
Copy link
Member

@lenemter lenemter commented Oct 11, 2025

Converts some window manager effect to use PropertyAnimator, which can handle disabled animations correctly by itself.

@lenemter lenemter marked this pull request as ready for review October 20, 2025 08:58
@lenemter lenemter requested a review from a team October 20, 2025 08:58
Copy link
Member

@leolost2605 leolost2605 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering whether it would be better to just have two utils methods something like this

Utils.prepare_animation (actor, time, mode);
// set actor properties 
actor.translation_x = 5;
Utils.run_animation (actor, () => { 
    // do some stuff after the animation finished
});

The utils methods would then just save and restore easing state depending on whether animations are enabled and the run_animation would then immediately call the callback or connect to the finished signal of an animation and then call the callback.
This would be less code and you can't accidentally write a property name wrong or have a type wrong.
This was just an idea and I'm open to other arguments though so lmk what you think 🤷

@lenemter
Copy link
Member Author

lenemter commented Nov 13, 2025

@leolost2605 I don't like this approach. The main downside of what you suggested is that there's no way to get the animated properties, so you have to use Clutter.Actor.transitions_completed and it can lead to some issues -- if you animate the actor two times, the on_stopped handlers might get fired at incorrect timing.

I don't really like passing properties around as strings, but I don't think there's a way around that unfortunately =( For now I added a warning when property name is incorrect. I'll see if I can find more robust way to pass properties (GLib.ParamSpec maybe?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants