tauri-apps/global-hotkey

Linux extremly slow register and unregister

Closed this issue · 3 comments

0-don commented

I am registereing about 30 hotkeys on Linux via tauri window display and hide events, it takes ages to register or unregister them

image

compared to windows which looks like this

image

I think this is because the GlobalHotKeyManager::register is waiting for the result of whether it was registered successfully or not from another thread. One way to solve this, would be to add another non-blocking API but you won't know if the hotkey was registered successfully or not.

Also may I ask Why do you need to register 30 hotkeys every time you hide/show the window, sounds unnecessary work? hotkeys are usually registered at the beginning of the application so even the currently slow API won't matter. Can you explain your use-case a bit more?

0-don commented

I built a clipboard manager which has a lot of hotkeys based on if its displayed or not.

Since the hotkeys are blocking the actual keys I have to unregister them everytime

This is now fixed and released in 4.1 and the performance of register_all and unregister_all should now match the performance of other platforms and is now 2711x times faster than 4.0