-
Notifications
You must be signed in to change notification settings - Fork 32
feat: enhancement for shortcut management #628
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @misaka18931, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: misaka18931 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Hi @misaka18931. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
a96d928 to
efac67c
Compare
c0259f6 to
78ffffa
Compare
254d652 to
f7adbf7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request refactors the shortcut management system from a hardcoded approach to a protocol-based, customizable implementation. The core change involves migrating shortcut handling logic from Helper::beforeDisposeEvent to a new shortcut management protocol (treeland-shortcut-manager-v2) with dedicated controller and runner components. Additionally, gesture handling is moved from hardcoded TogglableGesture instances in Helper to the protocol implementation, making shortcuts and gestures configurable via Wayland clients.
Key changes:
- Introduced
ShortcutManagerV2,ShortcutController, andShortcutRunnerclasses to manage shortcut registration, dispatch, and execution - Removed ~150 lines of hardcoded shortcut logic from
Helper::beforeDisposeEventand replaced with protocol-based dispatch - Created
ShortcutActionenum to categorize 23 different shortcut actions (workspace switching, window management, system actions, etc.)
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_protocol_shortcut/main.cpp | Updated test to use new ShortcutManagerV2 class name |
| src/seat/helper.h | Removed gesture properties and updated shortcut protocol reference |
| src/seat/helper.cpp | Removed ~200 lines of hardcoded shortcut/gesture logic; integrated new protocol-based system |
| src/modules/shortcut/shortcutrunner.h | New class to execute shortcut actions based on protocol requests |
| src/modules/shortcut/shortcutrunner.cpp | Implements action handlers for all 23 shortcut actions including workspace swipe animations |
| src/modules/shortcut/shortcutmanager.h | Defines V2 protocol interface and ShortcutAction enum |
| src/modules/shortcut/shortcutmanager.cpp | Implements session-aware shortcut management with pending/committed shortcut tracking |
| src/modules/shortcut/shortcutcontroller.h | Controller for registering and dispatching keyboard/gesture shortcuts |
| src/modules/shortcut/shortcutcontroller.cpp | Implements shortcut registration with conflict detection and gesture lifecycle management |
| src/modules/shortcut/impl/shortcut_manager_impl.h | Low-level protocol struct definitions for V2 manager |
| src/modules/shortcut/impl/shortcut_manager_impl.cpp | Wayland protocol implementation for bind/unbind/commit operations |
| src/modules/shortcut/CMakeLists.txt | Updated to build new shortcut components and use V2 protocol XML |
| src/input/togglablegesture.h | Removed workspace swipe-specific members (moved to ShortcutRunner) |
| src/input/togglablegesture.cpp | Removed workspace swipe implementation (~150 lines) |
| src/input/inputdevice.h | Added return values and unregister methods for gesture management |
| src/input/inputdevice.cpp | Implements gesture unregistration for cleanup |
| src/input/gestures.h | Added static opposite() helper for direction reversal |
| src/input/gestures.cpp | Implements SwipeGesture::opposite() utility function |
| examples/test_shortcut_manager/main.cpp | New example client demonstrating protocol usage |
| examples/test_shortcut_manager/CMakeLists.txt | Build configuration for example client |
| examples/CMakeLists.txt | Added new example subdirectory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f7adbf7 to
5ebe559
Compare
This commit introduces a major refactoring of the shortcut and gesture management system, moving away from hardcoded logic in `Helper` to the fully configurable treeland-shortcut-manager-v2 protocol. The shortcut management system has been refactored to be more modular and maintainable. Protocol interactions are handled in `ShortcutManagerV2`, with shortcut activation logic delegated to `ShortcutController` and shortcut execution handled by `ShortcutRunner`. TODO: A temporary shortcut manager client is written in `src/treeland-shortcut` for backward compatibility and to facilitate the transition to the new protocol. This needs to be removed once shortcut management is fully supported in DDE. Key Changes: - Introduced `ShortcutManagerV2` and `ShortcutController` to handle shortcut registration and dispatching via the Wayland protocol. - Added `ShortcutRunner` to execute actions triggered by shortcuts, replacing the monolithic switch-case logic in `Helper`. - Refactored `Helper::beforeDisposeEvent` to delegate key events to the new shortcut controller. - Removed `m_windowGesture` and `m_multiTaskViewGesture` from `Helper`. Gesture handling is now managed through the shortcut protocol. - Moved workspace swipe gesture handling from `TogglableGesture` into `ShortcutRunner`. - Added `test_shortcut_manager` example to demonstrate and test the new V2 protocol capabilities and usage. - Updated `test_protocol_shortcut` to verify the new server interface.
5ebe559 to
f0e8bb3
Compare
This commit introduces improvements to the shortcut management protocol, and refactors
Helper::beforeDisposeEventto purge hardcoded shortcuts in favor of the new shortcut management system.Changes:
Helper::beforeDisposeEventtoShortcutV1::handleKeySequenceandHelper::handleCompositorAction, respectively, and categorized previously defined shortcut actions intotreeland_shortcut_v1_actionenum.m_windowGestureand 'm_multiTaskViewGesturefromHelper, gesture handling is now moved within the protocol implementation oftreeland-shortcut-manager-v1`.TODO:
Refactor
TogglableGesture, as workspace swipe gestures is still hardcoded withinTogglableGesture, thus remains non-customizable.