Fix lingering mirrored surface after misinterpreted drag
When a window is dragged, a mirrored surface is created to show its
position while the original surface is hidden. This mirrored surface
must be cleaned up when the drag completes.
This cleanup is handled in two ways:
* For a standard move where the window lands at the final drag
position, a WindowDragTransitionHandler cleans up the surface in
its finishTransaction.
* In other cases where the final position is different (e.g., when a
window is snapped), this handler is not used, and the caller of
onDragPositioningEnd is responsible for the cleanup.
A bug occurred when a click on a window caption was misinterpreted as a
drag. This created a mirrored surface, but the drag ended immediately
with no change in bounds. This initiated a transition intended for the
WindowDragTransitionHandler, but because the bounds were unchanged, the
transition was empty. Shell aborts empty transitions, which prevented
the handler's finishTransaction from running and left the mirrored
surface on screen.
The fix prevents an empty transition from starting when the drag ends
without any actual movement. By avoiding the transition altogether in
this scenario, the cleanup responsibility correctly falls back to the
caller, making the behavior for a misinterpreted click consistent with
other non-handler cases.
Flag: EXEMPT - reverting a portion of a previous change
Bug: 442613884
Test: atest DesktopTasksControllerTest
Change-Id: Ib7393d109c12686cab6440b58ccfe91049f18a94
Loading
Please register or sign in to comment