handle onClickListener for synthesized MotionEvents

Since synthesized events can't be handled by GTK, we also need to handle
gestures by ourself in that case.
This commit is contained in:
Julian Winkler
2025-04-18 07:21:21 +02:00
parent db29a02c73
commit bd83e211d0
3 changed files with 6 additions and 3 deletions

View File

@@ -1076,7 +1076,7 @@ public class View implements Drawable.Callback {
private OnTouchListener on_touch_listener = null;
public boolean onTouchEventInternal(MotionEvent event) {
public boolean onTouchEventInternal(MotionEvent event, boolean handle_gestures) {
boolean handled = false;
if (on_touch_listener != null)
handled = on_touch_listener.onTouch(this, event);
@@ -1084,6 +1084,9 @@ public class View implements Drawable.Callback {
if (!handled)
handled = onTouchEvent(event);
if (handle_gestures && !handled && event.getAction() == MotionEvent.ACTION_UP)
handled = performClick();
return handled;
}