Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

fufesou
Copy link
Collaborator

@fufesou fufesou commented May 8, 2025

#5675
#11576
#10681

  1. Adjust mac -> win, trackpad speed. final _trackpadAdjustMacToWin = 2.50;
  2. Add a session setting for trackpad speed.

Preview

trackpad.speed.mp4
trackpad-speed-default.mp4

Note

Windows/macOS -> Windows/macOS/Linux, are tested, only macOS -> 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.

@fufesou fufesou requested a review from Copilot May 8, 2025 17:27
Copy link
Contributor

@Copilot Copilot AI left a 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.

flutter/lib/common/widgets/dialog.dart Outdated Show resolved Hide resolved
@fufesou fufesou force-pushed the feat/trackpad_speed branch from 4fec971 to 9a10b8c Compare May 8, 2025 17:31
@fufesou fufesou requested a review from Copilot May 8, 2025 17:31
Copy link
Contributor

@Copilot Copilot AI left a 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

flutter/lib/models/input_model.dart Show resolved Hide resolved
@fufesou fufesou requested a review from Copilot May 9, 2025 00:35
Copy link
Contributor

@Copilot Copilot AI left a 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) {

fufesou added 3 commits May 9, 2025 14:20
Signed-off-by: fufesou <linlong1266@gmail.com>
Signed-off-by: fufesou <linlong1266@gmail.com>
Signed-off-by: fufesou <linlong1266@gmail.com>
@fufesou fufesou force-pushed the feat/trackpad_speed branch from 8d1c7a8 to 5afa5e2 Compare May 9, 2025 07:31
@rustdesk rustdesk merged commit ca7b487 into rustdesk:master May 9, 2025
9 of 17 checks passed
@fufesou
Copy link
Collaborator Author

fufesou commented May 11, 2025

mac-win.mp4

For me, one trackpad scroll is about 10~15 lines.

p0we7 pushed a commit to p0we7/rustdesk that referenced this pull request May 11, 2025
* 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>
unwarkz pushed a commit to unwarkz/rustdesk that referenced this pull request May 23, 2025
* 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>
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.