Prevent spawning multiple pinning popups on right click

The dismiss logic only checks for `ACTION_DOWN` events, but when the
user frequently right-clicks OR right-press-move-release, we get
multiple `ACTION_MOVE` events instead, which are ignored by the dismiss
logic of the previous popup instance.

Attached screen recordings to the bug.

Bug: 362475367
Flag: EXEMPT bugfix
Test: manual
Change-Id: I665c3127e4b449a8f4c71e443cc6ae07c1bf2794
This commit is contained in:
Artsiom Mitrokhin
2024-11-25 10:38:48 -05:00
parent 8ed2ef9029
commit 86bf6ae902
@@ -91,6 +91,7 @@ public class TaskbarViewCallbacks {
public View.OnTouchListener getTaskbarDividerRightClickListener() {
return (v, event) -> {
if (event.isFromSource(InputDevice.SOURCE_MOUSE)
&& event.getAction() == MotionEvent.ACTION_DOWN
&& event.getButtonState() == MotionEvent.BUTTON_SECONDARY) {
mControllers.taskbarPinningController.showPinningView(v, getDividerCenterX());
return true;