-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
[bug] Global shortcuts are never triggered on Linux #307
[bug] Global shortcuts are never triggered on Linux #307
Comments
For me this is a major blocker to ship tiny Tauri app, let me know if I can help to debug or progress this bug. I can confirm shortcut trigger works on Mac and doesn't work on Linux (Pop OS 20.04). |
Please give us more information. What window compositor are you using? What does |
tauri info (from next branch)
Pop!_OS 20.04 LTS (with Nvidia drivers) |
Strangely Ctrl-T/CTRL+D for test/disable submenu works. Global shortcut only registered but never triggers. |
ok, we need to try to replicate this. thanks for the insight! |
@nothingismagick let me know if I can help debug it further - I don't mind running tauri under gdb or anything which will produce useful logs for you. |
cheers. am going to ask @wusyong to have a look and see if he can replicate. |
I have tried it on a clean install of pop os 20.04 and on 21.04, the issue is persistent. |
I also plan to revision our global handler since it's still only available on x11. |
Hurrah! I am going to test tonight. |
I think that broke now register in JS, if I run example/api and try to register global shortcut I get an empty array in Tauri console (screenshot) and error in JS console:
|
@AlexMikhalev i think you need to re-build the api package ( |
I rebuild before reporting the bug. I also rebuild it following the advice above, but global shortcuts are not triggered or registering now. |
@AlexMikhalev the promise rejection error is as stated by Fabian because of outdated api package. Please wait for the new release which should be so soon or test the globalShortcut functionality using tao directly, you can find an example in the |
@amrbashir ok, waiting for the new release of Tauri with bugfix. This probably means the bug isn't closed yet. |
@AlexMikhalev We released the first rc version yesterday 🥳 |
For whatever reason github didn't save my message so i try my best to replicate it from memory 😅
Yep we know that, but:
|
That is not right, This issue should just focus on x11 and wait for wayland to implement a protocol for global device events. |
Yeah you're right, just checked our convo again and I wasn't even able to spawn a winit window on Wayland back then (it still doesn't work and it's still crashing my system 😂) but the device events were working correctly on (x11) systems where our current shortcut implementation doesn't work, so that's what I mixed up in my previous comment. |
So, on Manjaro Gnome X11 neither That said, it's the first time I switched to X11 (over wayland) on this install. And it's had more shortcut issues as I've messed about with ibus/fcitx for IME's. I'll see if I can reproduce elsewhere. Any particular aspects you want me to test? |
Like mentioned here, on the installed OS I also see this. Also strange, the Tauri API example defaults to Ctrl+X (which is cut by default), and plays the 'drip' alert sound when pressed. Like it tried and failed to cut. Which it didn't do when the binding was working properly. I've not yet been able to find what caused it to break. |
@AlexMikhalev do you still have this issue? If so can you check if toggling |
For what it's worth, i can confirm that turning off numlock makes it work again. Took me some time to figure out that even tho my new keyboard doesn't have a numpad, num lock was still set to |
#538 should fix this. If you want to test the fix, add this to your Edit: the fix is now part of the dev branch [patch.crates-io]
tao = { git = "https://github.com/tauri-apps/tao", branch = "dev" } |
Looks like the issue still exists but it definitely has something to do with NumLock On/Off state |
Looks like this is a known X11 behavior, https://stackoverflow.com/questions/4037230/global-hotkey-with-x11-xlib. |
A new fix is up in #540, please test and give feedback, I will not merge it this time until I get confirmation. [patch.crates-io]
tao = { git = "https://github.com/tauri-apps/tao", branch = "dev" } Edit: fix is now part of |
Great! It works. Thanks! @amrbashir PS: As the dependencies of tauri (1.0.5) published on crates.io is : tauri (1.0.5) -> tauri-runtime-wry (^0.10.2) -> wry(^0.19) -> tao(^0.12), another patch should be added:
|
Describe the bug
Even using API example it's possible to register global shortcut, but it never triggers on linux
This line never reached.
Reproduction
Compile latest tauri (git commit 46f2eae8aad7c6a228eaf48480d5603dae6454b4) and run api example as per readme. Observe lack of global shortcut trigger - both JS and Rust examples don't work.
Expected behavior
Shortcut triggered - from JS and Rust
Platform and versions
Operating System - Pop!_OS, version 20.04 X64
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: