Skip to content

[Linux] Cannot receive receive more pointers on touchscreen #133239

@WeicongLee

Description

@WeicongLee

Steps to reproduce

Run the demo on the Linux touchscreen machine;

  1. One finger test:
    1. Run the demo on the Linux touchscreen machine;
    2. Touch on the screen and up;
  2. Two fingers test:
    1. On the premise that one finger has already touched;
    2. Touch the screen with the second finger;
  3. Three fingers test:
    1. On the premise that two fingers has already touched;
    2. Touch the screen with the third finger;

Expected results

  1. The first test expected results:
    Successfully received all events, all events type are touch;

  2. The second test expected results:
    Successfully received all events, received the new down and up, all events type are touch;

  3. The third test expected results:
    Successfully received all events, received the new down and up, all events type are touch;

Actual results

  1. The first test actual results:
    Successfully received all events, but all event types are mouse;

  2. The second test actual results:
    No new down event received, and there was no up event when the second finger was release;

  3. The third test actual results:
    Received the zoom events: ZoomStart, ZoomUpdate, ZoomEnd, and all event types are trackpad;

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Listener(
        onPointerDown: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerDown:${event}  kind:${event.kind}");
        },
        onPointerMove: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerMove:${event}  kind:${event.kind}");
        },
        onPointerUp: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerUp:${event}  kind:${event.kind}");
        },
        onPointerCancel: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerCancel:${event}  kind:${event.kind}");
        },
        onPointerPanZoomStart: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerPanZoomStart:${event}  kind:${event.kind}");
        },
        // TODO onPointerSignal 独立分发
        onPointerSignal: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerSignal:${event}  kind:${event.kind}");
        },
        onPointerHover: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerHover:${event}  kind:${event.kind}");
        },
        onPointerPanZoomEnd: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerPanZoomEnd:${event}  kind:${event.kind}");
        },
        onPointerPanZoomUpdate: (PointerEvent event) {
          debugPrint(
              "flutter-demo  onPointerPanZoomUpdate:${event}  kind:${event.kind}");
        },
        child: Container(
          color: Colors.yellow,
        ),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

Logs

Logs
  1. The first test logs
flutter: flutter-demo  onPointerDown:_TransformedPointerDownEvent#53ba5(position: Offset(208.1, 251.6))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#d62a9(position: Offset(208.6, 254.0))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#ffc41(position: Offset(211.0, 257.9))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#86f91(position: Offset(212.8, 263.0))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#ac328(position: Offset(215.2, 268.5))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#bd1bc(position: Offset(217.1, 275.9))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#5eee4(position: Offset(218.5, 282.2))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#407b4(position: Offset(219.9, 288.5))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#c94b3(position: Offset(221.3, 294.9))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#da376(position: Offset(221.3, 301.4))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#3fb59(position: Offset(222.7, 307.0))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#669cb(position: Offset(222.7, 311.7))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerMove:_TransformedPointerMoveEvent#7171a(position: Offset(222.7, 316.5))  kind:PointerDeviceKind.mouse
flutter: flutter-demo  onPointerUp:_TransformedPointerUpEvent#c31b4(position: Offset(222.7, 316.5))  kind:PointerDeviceKind.mouse
  1. The second test logs
no logs
  1. The third test logs
flutter: flutter-demo  onPointerPanZoomStart:_TransformedPointerPanZoomStartEvent#b2e4a(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomUpdate:_TransformedPointerPanZoomUpdateEvent#506cf(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomUpdate:_TransformedPointerPanZoomUpdateEvent#ffaba(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomUpdate:_TransformedPointerPanZoomUpdateEvent#b5e52(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomUpdate:_TransformedPointerPanZoomUpdateEvent#e6912(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomUpdate:_TransformedPointerPanZoomUpdateEvent#881a8(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomUpdate:_TransformedPointerPanZoomUpdateEvent#874b6(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad
flutter: flutter-demo  onPointerPanZoomEnd:_TransformedPointerPanZoomEndEvent#9a650(position: Offset(197.1, 299.1))  kind:PointerDeviceKind.trackpad

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.0, on BrilliaOS 5.10.179.ft, locale zh_CN.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] Connected device (2 available)
[!] Network resources                                        
    ✗ A cryptographic error occurred while checking "https://pub.dev/": Connection terminated during handshake
      You may be experiencing a man-in-the-middle attack, your network may be compromised, or you may have malware installed on your computer.
    ✗ A network error occurred while checking "https://maven.google.com/": Connection timed out
    ✗ An HTTP error occurred while checking "https://github.com/": Connection closed before full header was received

! Doctor found issues in 3 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: desktopRunning on desktopf: gesturesflutter/packages/flutter/gestures repository.frameworkflutter/packages/flutter repository. See also f: labels.platform-linuxBuilding on or for Linux specificallyr: duplicateIssue is closed as a duplicate of an existing issueteam-linuxOwned by the Linux platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions