Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: double-clicked callback not work on TouchArea #5142

Open
heng30 opened this issue Apr 28, 2024 · 2 comments
Open

Android: double-clicked callback not work on TouchArea #5142

heng30 opened this issue Apr 28, 2024 · 2 comments
Labels
a:platform-android Android platform integration (mO,bS) bug Something isn't working

Comments

@heng30
Copy link

heng30 commented Apr 28, 2024

  • platform: Android
  • Android target sdk version: 32
  • language: Rust
  • slint version: v1.5.1
  • style: material
  • code snippets
    TouchArea {
        moved => {
            debug("move ok");
        }

        pointer-event(evt) => {
            debug("pointer-event ok");
        }

        clicked => {
            debug("clicked ok");
        }

        double-clicked => {
            debug("double-clicked not work");
        }
    }
@heng30 heng30 changed the title Androd: double-clicked and scroll-event callback not work on TouchArea Android: double-clicked and scroll-event callback not work on TouchArea Apr 28, 2024
@heng30 heng30 changed the title Android: double-clicked and scroll-event callback not work on TouchArea Android: double-clicked callback not work on TouchArea Apr 28, 2024
@ogoffart ogoffart added bug Something isn't working a:platform-android Android platform integration (mO,bS) labels Apr 29, 2024
@ogoffart
Copy link
Member

ogoffart commented Apr 29, 2024

Thanks for reporting an issue.

The problem is that we send a MouseExit event on finger release, which cause the double click state to be reset.

// Also send exit to avoid remaining hover state
self.window.dispatch_event(WindowEvent::PointerExited);

(I've actually done the same on some MCU platform)

I think we have the following options:

  1. Don't send MouseExit on release in the android backend.
  2. Somehow not resetting the click_count on MouseExit. We have other mechanisms to find out it was done on the same item anyway.
  3. Have specific events for touch that wouldn't set the has_hover anyway without exit. But that's a bigger change.

@tronical
Copy link
Member

Don't send MouseExit on release in the android backend.

Perhaps that could be done with a delay? So that there's still a chance of doing a double tap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:platform-android Android platform integration (mO,bS) bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants