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

Stylus doesn't trigger PointerDownEvent #42846

Open
RimaitosLab opened this issue Oct 16, 2019 · 28 comments
Open

Stylus doesn't trigger PointerDownEvent #42846

RimaitosLab opened this issue Oct 16, 2019 · 28 comments
Labels
e: device-specific Only manifests on certain devices f: gestures flutter/packages/flutter/gestures repository. found in release: 1.20 Found to occur in 1.20 framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team

Comments

@RimaitosLab
Copy link

RimaitosLab commented Oct 16, 2019

The main problem

When you use a stylus as an input device, sometimes a PointerDownEvent gets triggered and then for the next 5-30sec the application doesn't handle any pointer inputs(it probably just freezes). Then I get a notice from the system that the app isn't responding and in that moment everything works as it should. The Problem then only reoccurs after you restart the Application.

Note: As long as I don't use the stylus everything works fine.

The main strange thing about this is that it only happens sometimes.

The second problem

When I press the button on my SPen and then touch the display, no pointer down events are triggered at all.

Steps to Reproduce

  1. Create a new Flutter Project and paste the content of the test application into main.dart (https://pastebin.com/PDuDVFQU)
  2. Load the application onto your test device
  3. Run the app (It seems to me, that this problem occurs with a higher probability if the data of the app is deleted beforehand, and the app is started from the device itself)

Target Platform: Android
Target OS version: 9
Devices: Samsung tab S4 (SM T830); Samsung Tab S3 (SM T820)

It seems like the problem occurs more frequently on the S4. But this could also be my imagination.

Logs

Log file: https://pastebin.com/9GFaVMUq
In line 1278 it says I didn't do anything for 20711 ms even though I instantly put the pen down again after I lifted it.

Flutter analyze doesn't return any issues (after you remove the curly brackets in the Strings which don't affect the problem)

[✓] Flutter (Channel beta, v1.10.7, on Linux, locale en_US.UTF-8)
    • Flutter version 1.10.7 at
      /home/ich/programming-libraries/flutter-sdk/flutter
    • Framework revision e70236e36c (2 weeks ago), 2019-10-02 09:32:30 -0700
    • Engine revision 9e6314d348
    • Dart version 2.6.0 (build 2.6.0-dev.4.0 1103600280)

 
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/ich/Android/Sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at:
      /home/ich/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.59002
      03/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses

[!] Android Studio (version 3.5)
    • Android Studio at
      /home/ich/.local/share/JetBrains/Toolbox/apps/AndroidStudio/ch-0/191.59002
      03
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[!] VS Code (version 1.39.1)
    • VS Code at /usr/share/code
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • SM T830                   • ce11182b6346556a1c7e • android-arm64 • Android
      9 (API 28)


! Doctor found issues in 3 categories.

Note: The doctor is wrong. I don't use VSCode and AndroidStudio is up to date with version 3.5.1

Thanks in advance for your help.

  • Rimaito
@BondarenkoStas BondarenkoStas added e: device-specific Only manifests on certain devices platform-android Android applications specifically f: gestures flutter/packages/flutter/gestures repository. framework flutter/packages/flutter repository. See also f: labels. labels Oct 16, 2019
@goderbauer
Copy link
Member

/cc @dkwingsmt

@RimaitosLab
Copy link
Author

Is this issue still being processed, or was it forgotten?
The Problem still exists as far as I can tell, and I would appreciate it if you would a least tell me whether it is my fault or an error in flutter.

@dkwingsmt
Copy link
Contributor

Sorry, I did forget this issue. Thanks for the reminder.

I'll try to find a device to reproduce this issue.

@RimaitosLab
Copy link
Author

Is there any update on this issue?

@RimaitosLab
Copy link
Author

Just as a side note, this issue still seems to exist, and it has been 2 months since the last answer. I would like to know what the sate of this issue is...

@iapicca
Copy link
Contributor

iapicca commented Jul 8, 2020

Hi @RimaitosLab
are you still experiencing the issue with the latest stable or above?
Thank you

@iapicca iapicca added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 8, 2020
@RimaitosLab
Copy link
Author

RimaitosLab commented Jul 8, 2020

I just tried the given example and at least on the Samsung tab S4 (SM T830), the behaviour hasn't changed. I haven't tested it on other devices yet.
The issue still doesn't appear consistently but out of 5 restarts, it froze 3 times.

flutter doctor output:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 1.20.0-3.0.pre.163, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✓] Android Studio (version 4.0)
[✓] Connected device (1 available)

• No issues found!

Best Regards!

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jul 8, 2020
@iapicca
Copy link
Contributor

iapicca commented Jul 10, 2020

I’m unable to reproduce the issue to pinpoint the cause. The issue needs further investigation.

@iapicca iapicca added found in release: 1.20 Found to occur in 1.20 will need additional triage This issue or PR needs attention during weekly triage labels Jul 10, 2020
@dkwingsmt
Copy link
Contributor

@iapicca I suspect this issue only exists on certain device.

@Hixie Hixie added P2 Important issues not at the top of the work list and removed will need additional triage This issue or PR needs attention during weekly triage labels Jul 14, 2020
@iapicca
Copy link
Contributor

iapicca commented Jan 8, 2021

@RimaitosLab
I see a PR landed in 1.22 to fix #67869
are you still experiencing the issue with the lasted stable?

tagging @TahaTesser for visibility

@RimaitosLab
Copy link
Author

It took me almost 15min to be able to reproduce the issue again. Both issues still exist.

This time while testing I enabled "Pointer location" in the developer options of android. This lead to the discovery that the whole system doesn't register any pointer events in the timespan.

I still cannot reproduce this issue reliably. I just try it a few times (many few times) and wait till it occurs.

If there is anything I could provide to help to solve this issue, please let me know.

@wanjm
Copy link

wanjm commented Jan 26, 2021

I also come across this problem, use hand first , everything works well then . If i use pen first, then app blocked;

write a simple app to catch move event, will trigger this easier;

@wanjm
Copy link

wanjm commented Jan 26, 2021

bugreport-MRX-W29-HUAWEIMRX-W29-2021-01-15-20-18-51.zip
attaced is the log when app no respond;

@Y0ngg4n
Copy link

Y0ngg4n commented Jul 26, 2021

I could reproduce the second issue.

@wanjm
Copy link

wanjm commented Dec 21, 2021

many users use android pad + stylus now. more any more people come across such problem

@Teages
Copy link

Teages commented May 1, 2022

The second issues is still exist on my test with Samsung Tab S6.

I use the example code of Listener for test.

  1. Hover and press the eraser button: works well, PointerEvent.buttons == 2, console log:
I/ViewRootImpl( 4205): updatePointerIcon pointerType = 20001, calling pid = 4205
D/InputManager( 4205): setPointerIconType defaultIconType = 20001, callingPid = 4205
  1. then, touch the screen with stylus, but not release the eraser button. The position frozen, and the Listener can not catch any event, console log:
I/[DWTE]  ( 4205): onPenEvent no editText
I/ViewRootImpl@ca24f60[MainActivity]( 4205): ViewPostIme pointer 0
I/ViewRootImpl( 4205): updatePointerIcon pointerType = 20001, calling pid = 4205
D/InputManager( 4205): setPointerIconType defaultIconType = 20001, callingPid = 4205
  1. leave the screen, console log:
I/ViewRootImpl@ca24f60[MainActivity]( 4205): ViewPostIme pointer 1
I/ViewRootImpl( 4205): updatePointerIcon pointerType = 20001, calling pid = 4205
D/InputManager( 4205): setPointerIconType defaultIconType = 20001, callingPid = 4205

If I swap the sequence of operations, it works well

  1. Hover but not press the eraser button
  2. touch the screen with stylus, then hold the eraser button, The value of PointerEvent.buttons changed from 1 to 2. the position is still updating.

Well, give up the function like temporary eraser is easy, but when the users try to use the eraser like they did in Samsung Notes or other software but it doesn't work, they will get confused or even angry. So I hope this issue can be solve properly

@Marc-R2
Copy link

Marc-R2 commented Nov 15, 2022

For me, this problem occurs as well.
A test app on my Galaxy Tab S7 (Android 12) detects the stylus itself when it hovers over the screen and when it touches the touchscreen.
When the function key is pressed, the stylus is also recognized as a stylus with pressed function key when hovering over the screen. However, as soon as I touch the touchscreen with the function key pressed, the PointerMoveEvents do not update and there is no PointerDownEvent.
Unfortunately I can't say more about this at the moment.

The previously mentioned bug, which caused the app to crash when touched with the stylus key pressed, has just been fixed.

@Nuckerr
Copy link

Nuckerr commented Dec 23, 2022

I just upgraded to master channel, the app no longer crashes when I press with the S-Pen with the side button pressed, however none of my tap functions work with gesture detectors etc.

@keev-LIM
Copy link

keev-LIM commented Jan 3, 2023

I just upgraded to master channel, the app no longer crashes when I press with the S-Pen with the side button pressed, however none of my tap functions work with gesture detectors etc.

I'm too

@WasteOfO2
Copy link

Although the issue with crashes has been fixed, the S Pen buttons still don't seem to work

Seeing the variety of devices reporting this, it is probably a Samsung-wide issue.

Tested on Samsung Galaxy Tab S6 Lite with the same result, dysfunctional S Pen buttons

@georgkrause
Copy link

I can confirm that the stylus button is not working on Galaxy Tab S6 Lite. If more debug information is needed, let me know!

@Iey4iej3
Copy link

Not working on Samsung S6 Lite under Lineage OS 20 as well.

@ceskyDJ
Copy link

ceskyDJ commented Jul 9, 2023

The same problem is on Samsung Galaxy Tab S8.

@jaween
Copy link

jaween commented Aug 13, 2023

I can confirm that the method posted by @Teagas still reproduces "the second problem" of this issue. I am using the latest Flutter stable with a Galaxy Tab S6 Lite and an S-Pen.

Scenario which fails:

  1. Hold down the stylus button
  2. Contact the screen
    (observe no pointer down/move events propagated to the app)
  3. Remove the contact
    (observe no pointer up event propagated to the app)

Steps 2 and 3 should have had pointer events received by the app.

Scenario which succeeds:

  1. Contact the screen
    (observe pointer down/move events received by the app)
  2. Hold down the stylus button
    (observe pointer move events continue to be received by the app)
  3. Release the contact
    (observe pointer up event received by the app)

Note, in the scenario that succeeds (and when the stylus is just hovering above the screen), the stylus button itself correctly appears in the PointerEvent.buttons bitmask as kPrimaryStylusButton. The problem is pressing the button before contacting the screen seems to disable all pointer events for this gesture.

Flutter doctor output
[✓] Flutter (Channel stable, 3.10.6, on Ubuntu 22.04.2 LTS 6.2.0-26-generic,
    locale en_AU.UTF-8)
    • Flutter version 3.10.6 on channel stable at /opt/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (5 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /home/jaween/Android/Sdk
    • Platform android-33-ext5, build-tools 33.0.2
    • Java binary at: /opt/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/linux#android-setup for
      more details.

[✗] Chrome - develop for the web (Cannot find Chrome executable at
    google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.

[✓] Linux toolchain - develop for Linux desktop
    • Ubuntu clang version 14.0.0-1ubuntu1.1
    • cmake version 3.22.1
    • ninja version 1.10.1
    • pkg-config version 0.29.2

[✓] Android Studio (version 2022.1)
    • Android Studio at /opt/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      11.0.15+0-b2043.56-8887301)

[✓] VS Code (version 1.81.0)
    • VS Code at /usr/share/code
    • Flutter extension version 3.70.0

[✓] Connected device (2 available)
    • SM P610 (mobile) • R52N70B0XPN • android-arm64 • Android 13 (API 33)
    • Linux (desktop)  • linux       • linux-x64     • Ubuntu 22.04.2 LTS
      8.2.0-26-generic

[✓] Network resources
    • All expected network resources are available.

! Doctor found issues in 2 categories.

@tangclue
Copy link

is there any update? I have same problem. Is there any update plan?

@Italo-ols
Copy link

I am having the same issue on an app that is built using flutter on my Galaxy tab s6 lite (Android 13).

@raffaem
Copy link

raffaem commented Dec 5, 2023

Any news on this? This is affecting Saber and Butterfly as well.

@gggirlgeek
Copy link

samsung tab s8 plus:
Same eraser button issue for me.

Thank you @Teases: for the tip to workaround the issue by pressing the button after holding the tip down on the screen. It's usable but not intuitive. You're awesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
e: device-specific Only manifests on certain devices f: gestures flutter/packages/flutter/gestures repository. found in release: 1.20 Found to occur in 1.20 framework flutter/packages/flutter repository. See also f: labels. P2 Important issues not at the top of the work list platform-android Android applications specifically team-android Owned by Android platform team triaged-android Triaged by Android platform team
Projects
None yet
Development

No branches or pull requests