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

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

Invoke |onDragPositioningEnd| even if not dragging

Icc15380b26f85c93a724966a7e09472b56f0d259 made it so |mIsDragging| is
not flipped on ACTION_MOVE if the bounds don't actually change to fix an
issue where the dragging state isn't cleaned up and clicks stop working.
While valid, this has the side effect of ACTION_UP/ACTION_CANCEL not
dispatching |onDragPositioningEnd| calls to the positioner and
controller even if |onDragPositioningStart,Move| did get called because
they're guarded by an |mIsDragging| check. This resulted in visual
indicators being created in |ACTION_MOVE| but not getting released ever
if the gesture included DOWN->MOVE->UP where the bounds didn't actually
change, such as when doing a slightly longer click that doesn't cross
the slop threshold.

With this change, the |mIsDragging| early break in UP/CANCEL is moved
down to let most of the handling (including calling
onDragPositioningEnd) run. It also adds an early check to |dragAllowed|,
which is what UP and MOVE use to break out early since we know
|start/move| aren't called when that is false and |end| shouldn't either.

Flag: com.android.window.flags.fix_leaking_visual_indicator
Fix: 418225224
Test: open Chrome and Calculator in desktop windowing:
1) Arrange Chrome so that it is at the top edge of the screen (just
   below the status bar)
2) Arrange Calculator so that it is at the bottom-right of the screen
   and in front of Chrome
3) Using a mouse or trackpad, click (or long click) Chrome's app header
   where it meets the horizontal center of the *screen* (not the center
   of the app header necessarily)
Repeat a few times since it's not 100% reproducible (see bug for more
info)
Test: atest WMShellUnitTests

Change-Id: Iacff373774fa26f6650e6eeca581ed1bf986c262
parent ac3bc3ad
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