Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cfed47a6 authored by Jorge Gil's avatar Jorge Gil
Browse files

Skip return-to-start drag animation if already at end

The return-to-start drag animation is meant for when a task is dragged
away from its start position and dropped in an "invalid" area, such as
partially off-screen. However, it's possible that the task is dropped
exactly where it started being dragged, in which case running this
animation shouldn't be necessary.

Also, this is especially problematic at times when a simple click using
a mouse generates ACTION_DOWN->ACTION_MOVE->ACTION_UP without actually
changing position, which was triggering this repositioning animation and
if the click was on the close (X) button, the task surface could become
invalid while the animation was still running, leading to a crash.

This change:
1) Checks the "drop" bounds (i.e. current bounds on the |end| callback)
   aren't the same as the destination bounds and skips the animation if
   they are.
2) Within the animator itself, skips the animation if start/end bounds
   are the same.
3) Checks surfaces are still valid before using them.

Flag: EXEMPT refactor
Fix: 440380144
Test: atest DesktopTasksControllerTest
Change-Id: Iff344ad667bc5490a7bdbb544ac8cdaaea8d263f
parent afaaf340
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment