tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
81.23k stars 2.42k forks source link

[bug] #7789

Closed EpsilonEpsilon closed 11 months ago

EpsilonEpsilon commented 11 months ago

Shortcuts doesn't work on Linux (Ubuntu)

Reproduction

Describe the bug

I'm trying to register global shortcut

await registerAll(["Shift+I"], () => {
        //some code
      });

On frontend i get rejected promise

Unhandled Promise Rejection: Unable to register global shortcut

On mac os everything works fine.

Expected behavior

No response

Platform and versions

[✘] Environment
    - OS: Ubuntu 22.04 X64
    ✔️ webkit2gtk-4.0: 2.40.5
    ✘ rsvg2: not installed
      Visit https://tauri.app/v1/guides/getting-started/prerequisites to learn more about tauri prerequisites
    ✔️ rustc: 1.72.0 (5680fa18f 2023-08-23)
    ✔️ Cargo: 1.72.0 (103a7ff2e 2023-08-15)
    ✔️ rustup: 1.26.0 (5af9b9484 2023-04-05)
    ✔️ Rust toolchain: stable-x86_64-unknown-linux-gnu (default)
    - node: 18.17.1
    - yarn: 1.22.19
    - npm: 9.6.7

[-] Packages
    - tauri [RUST]: 1.4.1
    - tauri-build [RUST]: 1.4.0
    - wry [RUST]: 0.24.3
    - tao [RUST]: 0.16.2
    - @tauri-apps/api [NPM]: 1.4.0
    - @tauri-apps/cli [NPM]: 1.4.0

[-] App
    - build-type: bundle
    - CSP: unset
    - distDir: ../dist
    - devPath: http://localhost:1420/
    - framework: React
    - bundler: Vite

Stack trace

No response

Additional context

No response

FabianLars commented 11 months ago

This could be related to https://github.com/tauri-apps/tauri/issues/3578 since iirc ubuntu 22.04 uses wayland by default (in contrast to prior ubuntu versions that all defaulted to x11).

Can you check if it registers it fine on x11?

EpsilonEpsilon commented 11 months ago

yea, on x11 shortcuts works

FabianLars commented 11 months ago

Alright, thanks. I'm closing this as a duplicate of #3578 then :)