Skip to content

LogicalKeySet Not Working on Linux Environment #156806

@Losses

Description

@Losses

Steps to reproduce

  1. Create a new Flutter project.
  2. Implement the Shortcuts widget with a specific key combination.
  3. Test the functionality on a Windows machine (works as expected).
  4. Test the same functionality on a Linux machine (does not work).

Expected results

The shortcuts should trigger the associated actions on both Windows and Linux environments.

Actual results

The shortcuts only trigger the actions on Windows. On Linux, there is no response when the key combination is pressed.

Code sample

The official demo of shortcuts is enough to demonstrate this:

https://dartpad.dev/?embed=true&split=60&run=true&sample_id=widgets.Shortcuts.2&channel=stable

Screenshots or Video

Screenshots / Video demonstration
2024-10-15.15-38-06.mp4

Logs

Logs
flutter run
Launching lib/main.dart on Linux in debug mode...
Building Linux application...                                           
✓ Built build/linux/x64/debug/bundle/shortcut_demo

** (shortcut_demo:106985): CRITICAL **: 15:36:29.180: Failed to read XDG desktop portal settings: GDBus.Error:org.freedesktop.portal.Error.NotFound: Requested setting not found

** (shortcut_demo:106985): CRITICAL **: 15:36:29.180: Failed to read XDG desktop portal settings: GDBus.Error:org.freedesktop.portal.Error.NotFound: Requested setting not found

** (shortcut_demo:106985): CRITICAL **: 15:36:29.181: Failed to read XDG desktop portal settings: GDBus.Error:org.freedesktop.portal.Error.NotFound: Requested setting not found

** (shortcut_demo:106985): CRITICAL **: 15:36:29.181: Failed to read XDG desktop portal settings: GDBus.Error:org.freedesktop.portal.Error.NotFound: Requested setting not found

** (shortcut_demo:106985): CRITICAL **: 15:36:29.181: Failed to read XDG desktop portal settings: GDBus.Error:org.freedesktop.portal.Error.NotFound: Requested setting not found

(shortcut_demo:106985): Atk-CRITICAL **: 15:36:29.181: atk_socket_embed: assertion 'plug_id != NULL' failed
Syncing files to device Linux...                                    50ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

A Dart VM Service on Linux is available at: http://127.0.0.1:40701/TtwvhbbgA4U=/
The Flutter DevTools debugger and profiler on Linux is available at: http://127.0.0.1:9102?uri=http://127.0.0.1:40701/TtwvhbbgA4U=/
Lost connection to device.

Flutter Doctor output

Doctor output
flutter doctor -v
[✓] Flutter (Channel stable, 3.24.1, on NixOS 24.05 (Uakari) 6.11.2, locale en_US.UTF-8)
    • Flutter version 3.24.1 on channel stable at /nix/store/cpgyn3rn3a117nv4s1g7j5ajgbdkplby-flutter-wrapped-3.24.1-sdk-links
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision nixpkgs000 (), 1970-01-01 00:00:00
    • Engine revision c9b9d5780d
    • Dart version 3.5.1
    • DevTools version 2.37.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /nix/store/jlm9zzh56f609sxlnzz78n57vj5kk2h9-android-sdk-env/share/android-sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /nix/store/jlm9zzh56f609sxlnzz78n57vj5kk2h9-android-sdk-env/share/android-sdk
    • ANDROID_SDK_ROOT = /nix/store/jlm9zzh56f609sxlnzz78n57vj5kk2h9-android-sdk-env/share/android-sdk
    • Java binary at: /nix/store/xy53lk4001h814d7dwh8f52wcqxrn7rp-openjdk-17.0.11+9/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.11+9-nixos)
    • All Android licenses accepted.

[✗] 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
    • clang version 18.1.8
    • cmake version 3.29.6
    • ninja version 1.12.1
    • pkg-config version 0.29.2

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).

[✓] Connected device (1 available)
    • Linux (desktop) • linux • linux-x64 • NixOS 24.05 (Uakari) 6.11.2

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

! Doctor found issues in 2 categories.

In addition, I'm using Fcitx 5.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopd: api docsIssues with https://api.flutter.dev/found in release: 3.24Found to occur in 3.24found in release: 3.27Found to occur in 3.27has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged 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