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

Move global shortcut handling into OSUtils #5566

Merged
merged 2 commits into from
Dec 14, 2020

Conversation

droidmonkey
Copy link
Member

@droidmonkey droidmonkey commented Oct 18, 2020

Complete overhaul of global shortcut handling. Removed all shortcut handling from Auto-Type classes into OSUtils. Enabled by-name referencing of global shortcuts.

Performed cleanup of X11 functions in Linux Auto-Type.

This is prep work to adding multiple global shortcuts including "Show KeePassXC" and "Auto-Type Password Only".

TODO:

  • Detect and fail if duplicate global shortcuts are being defined
  • Cleanup CMakeLists.txt for Auto-Type

Testing strategy

Tested functionality in Windows, Linux, and macOS. Minimal changes to unit tests!

Type of change

  • ✅ Refactor (significant modification to existing code)

@droidmonkey droidmonkey added this to the v2.7.0 milestone Oct 18, 2020
@droidmonkey droidmonkey marked this pull request as draft October 18, 2020 15:59
@droidmonkey droidmonkey force-pushed the feature/autotype-upgrade branch 2 times, most recently from f281b7a to af36eeb Compare October 25, 2020 14:12
@droidmonkey droidmonkey force-pushed the feature/autotype-upgrade branch 2 times, most recently from faa5f46 to 4088de8 Compare November 1, 2020 14:29
@droidmonkey droidmonkey marked this pull request as ready for review November 1, 2020 14:36
return false;
}

bool NixUtils::triggerGlobalShortcut(uint keycode, uint modifiers)
Copy link
Member

Choose a reason for hiding this comment

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

If this is directly a part of NixUtils, how are we handling Wayland in the future? That would be an entirely new implementation. It could make sense to add the necessary abstractions already. I believe it should also be possible to build without X11 headers present on the system.

Copy link
Member Author

@droidmonkey droidmonkey Nov 4, 2020

Choose a reason for hiding this comment

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

Perhaps we need an X11Utils and WaylandUtils. I did move some of the X11 quirks into a separate cpp.

Copy link
Member

Choose a reason for hiding this comment

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

I'd rather think we need to add another abstraction layer there. As I see it, NixUtils will grow with additional features that are specific to certain DEs and we don't want to duplicate all that unnecessarily.

Copy link
Contributor

Choose a reason for hiding this comment

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

I also think that the possibility to handle features specific to DEs is necessary. And FYI what a DE-specific implementation looks like: I tried to implement auto-type on KDE Wayland a while ago.

* Add shortcut error handling and duplicate shortcut detection
* Improve linux build settings to prevent issues with PIC and PIE protections
@droidmonkey droidmonkey merged commit 404fd94 into develop Dec 14, 2020
@droidmonkey droidmonkey deleted the feature/autotype-upgrade branch December 14, 2020 04:23
Hello71 added a commit to Hello71/keepassxc that referenced this pull request Mar 24, 2022
After 404fd94 ("Move global shortcut handling into OSUtils
(keepassxreboot#5566)"), X11Extras was made mandatory, even though it is only used for
autotype. Make it conditional on autotype again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants