Skip to content
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

Implement global shortcut on Linux, close #307 #308

Merged
merged 5 commits into from Feb 10, 2022
Merged

Conversation

wusyong
Copy link
Member

@wusyong wusyong commented Feb 8, 2022

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.
  • I have added a convincing reason for adding this feature, if necessary

Other information

Wu Yu Wei added 2 commits February 7, 2022 20:53
This one set accelerator group to each window.
It's not the real global shortcut. If no window is active, all shortcuts
won't work.
@wusyong wusyong requested a review from a team February 8, 2022 09:29
@wusyong wusyong requested a review from a team as a code owner February 8, 2022 09:34
@wusyong wusyong changed the title Implement global shortcut on Linux Implement global shortcut on Linux, close #307 Feb 8, 2022
Copy link
Member

@amrbashir amrbashir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have been thinking we should remove globalShortcut module anyway and use DeviceEvent::Key and tauri or any tao user can keep their own hashmap of global shortcuts and build their global shortcut manager as they see fit on top of DeviceEvent::Key, this has been also proposed by a maintainer at winit. This could also help us when we move back to winit.

DeviceEvent::Key is currently not implemented on gtk I think.

cc @lucasfernog

.changes/linux-shortcuts.md Outdated Show resolved Hide resolved
src/platform_impl/linux/event_loop.rs Outdated Show resolved Hide resolved
@lucasfernog
Copy link
Member

I have been thinking we should remove globalShortcut module anyway and use DeviceEvent::Key and tauri or any tao user can keep their own hashmap of global shortcuts and build their global shortcut manager as they see fit on top of DeviceEvent::Key, this has been also proposed by a maintainer at winit. This could also help us when we move back to winit.

DeviceEvent::Key is currently not implemented on gtk I think.

cc @lucasfernog

I think that can be part of a next iteration, maybe for Tauri 1.1 since it's too big of a change to do it now.

@amrbashir
Copy link
Member

Sounds good to me.

Now we only need to make this PR global and not specific to a window.

@wusyong wusyong requested a review from a team February 9, 2022 09:14
src/platform_impl/linux/event_loop.rs Show resolved Hide resolved
src/platform_impl/linux/global_shortcut.rs Outdated Show resolved Hide resolved
src/platform_impl/linux/global_shortcut.rs Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants