feat: add Active as default for MuxRumbleTarget enum#50
Merged
Conversation
only toggle should be effected
to make it simpler to find by default
… mux/demux examples and avoid race conditions in discovering resources
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds the Active rumble target as the default for the MuxRumbleTarget enum, enabling dynamic force feedback routing based on currently active controllers in toggle mode. The PR also includes several related improvements to signal handling, file locking, and dependency management.
Changes:
- Introduces
MuxRumbleTarget::Activeenum variant with active controller tracking for dynamic force feedback routing - Replaces
ctrlcwithsignal-hookto support both SIGINT and SIGTERM signals - Adds file locking with
fs2for Steam config file modifications to prevent race conditions - Updates dependencies (gilrs, ashpd, clap, libc, log, toml)
Reviewed changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/mux/mod.rs | Defines new MuxRumbleTarget enum with Active as default |
| src/mux/runtime.rs | Implements active controller tracking with generation-based FF rebuild system |
| src/mux/modes/mod.rs | Adds MuxOutput struct and initial_active_controllers trait method |
| src/mux/modes/toggle.rs | Updates toggle mode to report active controller changes |
| src/mux/modes/priority.rs | Updates priority mode to use new MuxOutput structure |
| src/mux/modes/average.rs | Updates average mode to use new MuxOutput structure |
| src/mux/manager.rs | Updates manager to pass IDs to RuntimeSettings initialization |
| src/demux/mod.rs | Moves DemuxRumbleTarget enum from runtime.rs to mod.rs |
| src/demux/runtime.rs | Removes DemuxRumbleTarget enum definition |
| src/demux/manager.rs | Updates import for DemuxRumbleTarget |
| src/utils/hide.rs | Adds file locking for Steam config modifications |
| src/tray/mod.rs | Replaces tokio::signal::ctrl_c with unix signal handlers |
| src/tray/app.rs | Adds Active variant to rumble menu and updates mode change handler |
| src/tray/config.rs | Updates types to use module-specific rumble enums |
| src/tray/state.rs | Updates types to use module-specific rumble enums |
| src/main.rs | Replaces ctrlc with signal-hook for SIGINT/SIGTERM handling |
| README.md | Adds cookbook section with examples and fixes grammar |
| Cargo.toml | Updates dependencies and removes ctrlc |
| Cargo.lock | Reflects dependency updates |
| flatpak/cargo-sources.json | Updates flatpak dependency sources |
| .vscode/settings.json | Adds spelling entries |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Refactored run_input_loop and RuntimeSettings::update_mode to eliminate double creation of mux mode instances when switching modes. Now, the mode instance is created once, used to obtain default active controllers, and passed to update_mode, improving efficiency and clarity.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.