mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-08 13:38:45 +02:00
animation,throbber: allow calling stop after animation is stopped
Right now if a user calls ply_throbber_stop or ply_animation_stop after the animation is stopped things malfunction. In the case of the throbber we end up never calling the stop completion handler passed in, and in the case of the animation, we end up setting some state that shouldn't be set. This commit checks if the animation and throbber objects are stopped, and if so does the necessary steps to process the late stop request. Spotted by Dave Airlie
This commit is contained in:
parent
d37da49aca
commit
02c70f069b
2 changed files with 14 additions and 0 deletions
|
|
@ -353,6 +353,11 @@ ply_animation_stop_now (ply_animation_t *animation)
|
|||
void
|
||||
ply_animation_stop (ply_animation_t *animation)
|
||||
{
|
||||
if (animation->is_stopped) {
|
||||
ply_trace ("animation already stopped, ignoring stop request");
|
||||
return;
|
||||
}
|
||||
|
||||
if (animation->stop_trigger == NULL) {
|
||||
ply_animation_stop_now (animation);
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -337,6 +337,15 @@ void
|
|||
ply_throbber_stop (ply_throbber_t *throbber,
|
||||
ply_trigger_t *stop_trigger)
|
||||
{
|
||||
if (throbber->is_stopped) {
|
||||
ply_trace ("throbber already stopped");
|
||||
if (stop_trigger != NULL) {
|
||||
ply_trace ("pulling stop trigger right away");
|
||||
ply_trigger_pull (stop_trigger, NULL);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (stop_trigger == NULL) {
|
||||
ply_throbber_stop_now (throbber);
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue