-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
feat, trackpad speed #11680
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
feat, trackpad speed #11680
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.
Pull Request Overview
This PR implements a new session setting for trackpad speed and adjusts the trackpad speed behavior (especially for macOS to Windows connections) as discussed in related RustDesk issues. Key changes include:
- Adding “Trackpad speed” localization entries in multiple languages.
- Implementing trackpad speed updates and adjustments in the input model.
- Introducing new Flutter UI components (a slider widget and dialog) to configure trackpad speed.
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/lang/*.rs | Added new "Trackpad speed" key for localizations across various languages. |
flutter/lib/models/model.dart | Invoked updateTrackpadSpeed() for desktop sessions. |
flutter/lib/models/input_model.dart | Added trackpad speed adjustment constants and updated trackpad handling logic. |
flutter/lib/desktop/widgets/remote_toolbar.dart | Added new menu button to open the trackpad speed dialog. |
flutter/lib/consts.dart | Added new constants for trackpad speed configuration. |
flutter/lib/common/widgets/setting_widgets.dart | Introduced a new TrackpadSpeedWidget for configuring trackpad speed. |
flutter/lib/common/widgets/dialog.dart | Added a new trackpadSpeedDialog to handle trackpad speed settings. |
4fec971
to
9a10b8c
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 PR adjusts trackpad speed handling for the mac → Windows scenario and adds a new session setting along with UI components for trackpad speed adjustment.
- Updated localization files to include the new "Trackpad speed" key.
- Modified the InputModel to factor in new constant adjustments and added an async method to update trackpad speed.
- Added new UI elements (a button, dialog, and slider widget) to let users configure trackpad speed.
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/lang/*.rs | Added new localization key for "Trackpad speed" across multiple language files |
flutter/lib/models/model.dart | Inserted a call to update trackpad speed when running on desktop |
flutter/lib/models/input_model.dart | Integrated new constants and logic for adjusting trackpad speed with proper scaling |
flutter/lib/desktop/widgets/remote_toolbar.dart | Added a new button to launch the trackpad speed dialog |
flutter/lib/consts.dart | Introduced new constants for trackpad speed settings |
flutter/lib/common/widgets/setting_widgets.dart | Added a new stateful widget for adjusting trackpad speed via a slider and text field |
flutter/lib/common/widgets/dialog.dart | Added a new dialog function to configure and save the trackpad speed setting |
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 PR introduces adjustments to the trackpad speed configuration, addressing the macOS-to-Windows speed discrepancy and providing a dedicated session setting and UI controls for trackpad speed. Key changes include:
- Adding a new translation key for "Trackpad speed" in various language files.
- Updating the input model to include separate adjustment factors (_trackpadAdjustMacToWin and _trackpadAdjustPeerLinux) and a new method to update the trackpad speed from session settings.
- Introducing UI components (a slider widget and dialog) to allow users to configure trackpad speed.
Reviewed Changes
Copilot reviewed 52 out of 52 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/lang/*.rs | Added a new key for "Trackpad speed" across multiple locales. |
flutter/lib/models/model.dart | Calls updateTrackpadSpeed() for desktop sessions. |
flutter/lib/models/input_model.dart | Implements trackpad speed update and adjustment calculations. |
flutter/lib/desktop/widgets/remote_toolbar.dart | Adds a button to trigger the trackpad speed dialog. |
flutter/lib/consts.dart | Introduces new trackpad speed constants. |
flutter/lib/common/widgets/setting_widgets.dart | Provides a slider and text field widget for trackpad speed. |
flutter/lib/common/widgets/dialog.dart | Adds a dialog to allow the user to adjust the trackpad speed. |
Comments suppressed due to low confidence (2)
flutter/lib/models/input_model.dart:351
- [nitpick] The variable name '_trackpadSpeed' may be confused with a fixed or constant speed value. Consider renaming it (e.g., to '_currentTrackpadSpeedFactor') to clearly indicate its role in dynamically storing the current multiplier.
double _trackpadSpeed = kDefaultTrackpadSpeed;
flutter/lib/common/widgets/dialog.dart:1643
- Consider defining a named constant for the delta threshold (currently 0.01) used to detect meaningful changes in trackpad speed. This would improve code clarity and make future adjustments easier.
if (curSpeed.value <= kMaxTrackpadSpeed && curSpeed.value >= kMinTrackpadSpeed && (curSpeed.value - initSpeed).abs() > 0.01) {
Signed-off-by: fufesou <linlong1266@gmail.com>
Signed-off-by: fufesou <linlong1266@gmail.com>
8d1c7a8
to
5afa5e2
Compare
mac-win.mp4For me, one trackpad scroll is about |
* feat, trackpad speed Signed-off-by: fufesou <linlong1266@gmail.com> * comments Signed-off-by: fufesou <linlong1266@gmail.com> * Trackpad speed, user default value Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
* feat, trackpad speed Signed-off-by: fufesou <linlong1266@gmail.com> * comments Signed-off-by: fufesou <linlong1266@gmail.com> * Trackpad speed, user default value Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
#5675
#11576
#10681
final _trackpadAdjustMacToWin = 2.50;
Preview
trackpad.speed.mp4
trackpad-speed-default.mp4
Note
Windows/macOS
->Windows/macOS/Linux
, are tested, onlymacOS
->Windows
seems to be very slow.Linux
as the controlling side is not tested, because VM does not trigger the trackpad events. Flutter can only detect the mouse events.