Skip to content

Android: Fix right click getting triggered when stylus isn't moved much

Sharaf Zaman requested to merge szaman/krita:android-longpress into master

Problem:

If you slightly move the stylus on canvas, Android's gesture detector thinks that this is just a natural jitter and sends long-press "event" (which in turn launches the assigned action, default one being popup palette). In fa7e7016, I modified the platform code to handle long press in a way that we first end (or cancel if available) the previous event (touch/tablet). And then send a right click event. This prevents Qt from immediately firing the highlighted item in context menu.

This resulted in a problem where canvas would show popup palette whenever stylus was moved in a minimal fashion, earlier it didn't happen because when the tablet events were on (as we never ended the event) the mouse events would be blocked.

Solutions:

  1. Disabling right click for all but touch events for which the Gesture Detector is optimized.
  2. Tuning the gesture detector to handle stylus events as well.
  3. Reverting fa7e7016 and letting things work like before.

What do you think would be the best solution given the use case of this feature?

Merge request reports

Loading