* fix: prevent custom scale dialog from closing when interacting with slider
Wrapped MobileCustomScaleControls in GestureDetector with opaque behavior
to prevent touch events from propagating to parent dialog's clickMaskDismiss
handler. The slider now works correctly without closing the dialog.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Revert "fix: mobile remove "Scale custom" (#13323)"
This reverts commit 265d08fc3b.
* chore: keep remote_toolbar.dart cleanup (remove dead code)
The dead code removed in 265d08fc3 hasn't been used since Aug 2023.
Only reverting toolbar.dart is needed for the mobile Scale custom fix.
* Update flutter/lib/mobile/pages/remote_page.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: Implement CustomScaleControlsMixin for shared scaling logic across mobile and desktop widgets
- Introduced a new mixin `CustomScaleControlsMixin` to encapsulate custom scale control logic, allowing for code reuse in both mobile and desktop widgets.
- Refactored `_CustomScaleMenuControlsState` and `_MobileCustomScaleControlsState` to utilize the new mixin, simplifying the scaling logic and reducing code duplication.
- Updated slider handling and state management to leverage the mixin's methods for improved maintainability.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/widgets/custom_scale_widget.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/mobile/pages/remote_page.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor: changed from mixin to abstract class
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Revert "Update flutter/lib/mobile/pages/remote_page.dart"
This reverts commit 7c35897408.
* refactor: remove unnecessary tap event handling in custom scale controls
- Removed the `onTap` handler from the
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor: simplify MobileCustomScaleControls usage in remote_page.dart
- Removed unnecessary GestureDetector wrapper around MobileCustomScaleControls for cleaner code.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
---------
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Repurposed the MacOS-specific platform channel mechanism for all platforms:
- Renamed the channel from "org.rustdesk.rustdesk/macos" to "org.rustdesk.rustdesk/host".
- Renamed _osxMethodChannel in platform_channel.dart to _hostMethodChannel.
- Updated linux/my_application.cc to use the fl_* API to set up a Method Channel and to dispose it during my_application_dispose.
- Updated windows/runner/flutter_window.cpp to use the C++ API to set up a Method Channel.
- Updated the channel name in macos/Runner/MainFlutterWindow.swift.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Added a method "bumpMouse" to the Platform Channel.
Added a thunk to call the method through the channel to platform_channel.dart.
Added implementation bump_mouse() in linux/my_application.cc using Gdk API calls. Updated host_channel_call_handler to process "bumpMouse" method call messages by calling bump_mouse.
Added implementation Win32Desktop::BumpMouse in windows/runner/win32_desktop.cpp/.h. Updated the inline method call handler in flutter_window.cpp to handle "bumpMouse" method calls by calling Win32Desktop::BumpMouse.
Updated the method call handler in macos/Runner/MainFlutterWindow.swift to handle "bumpMouse" method call messages. Updated MainFlutterWindow to use a subclass of FlutterViewController exposing access to mouseLocationOutsideOfEventStream.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Added message type kWindowBumpMouse to the multiwindow window event model:
- Added constant kWindowBumpMouse to consts.dart.
- Updated the method handler attached to rustDeskWinManager by DesktopHomePageState to recognize kWindowBumpMouse and translate it to a call to RdPlatformChannel.bumpMouse.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Centralized serialization of ScrollStyle values, moving JSON and string conversions into methods toString/fromString and toJson/fromJson within the type.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Added new scroll style for edge scrolling:
- Added ScrollStyle enum member "scrolledge". Added corresponding constant kRemoteScrollStyleEdge to consts.dart for the string serialized form.
- Updated sites checking specifically for ScrollStyle.scrollbar to instead check for NOT ScrollStyle.scrollauto.
- Added radio buttons for the new "ScrollEdge" style to desktop_setting_page.dart and remote_toolbar.dart. Added new string "ScrollEdge" to lang/template.rs.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Implemented edge scrolling:
- Added methods edgeScrollMouse and pushScrollPositionToUI to class CanvasModel in model.dart.
- Added boolean parameter edgeScroll to handleMouse, handlePointerDevicePos and processEventToPeer in input_model.dart.
- Updated handlePointerDevicePos in input_model.dart to call edgeScrollMouse on move events when the edgeScroll parameter is true.
- Added convenience accessor useEdgeScroll to the InputModel class. Updated call sites to handleMouse to use it to supply the value for the edgeScroll parameter.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Updated CanvasModel.edgeScrollMouse to be resilient to receiving events when _horizontal/_vertical aren't wired up to any UI.
* Updated CanvasModel to take notifications of resizes via method notifyResize and to suppress edge scrolling briefly after a resize.
Updated the onWindowResized handler in tabbar_widget.dart to call notifyResize on the canvasModel of any RemotePage tabs.
* Half a go at fixing MainFlutterWindow.swift.
* Copilot feedback.
* Applied fix suggested by Copilot in its explanation of the build error.
* Fixed a couple of silly errors in windows/runner/flutter_window.cpp.
* Fixed MainFlutterWindow.swift build errors.
Co-Authored-By: fufesou <linlong1266@gmail.com>
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Moved new translation to the end of template.rs.
Reran res/lang.py.
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
* Switched MainFlutterWindow.swift to use NSEvent.mouseLocation.
* Updated MainFlutterWindow.swift code based on build error.
* Fixed silly typo.
* Reintroduced the coordinate system translation in MainFlutterWindow.swift.
* Updated edgeScrollMouse in model.dart to add a "safe zone" around the window frame that doesn't trigger edge scrolling.
* Updated the bumpMouse handler in MainFlutterWindow.swift to call CGAssociateMouseAndMouseCursorPosition to cancel event suppression.
* Added debug annotation to the onWindowResized event in tabbar_widget.dart.
* Fix parameter type for CGAssociateMouseAndMouseCursorPosition in MainFlutterWindow.swift.
* tabbar_widget.dart: onWindowResized -> onWindowResize
* Removed temporary diagnostic debugPrint from tabbar_widget.dart.
* Updated MainFlutterWindow.swift to obtain the mouse position by creating a dummy CGEvent. The old NSEvent.mouseLocation code is left as a fallback.
* The documentation said to be sure to call CFRelease, but apparently it's a build error to do so. :-P
* Replaced CGEvent calls in MainFlutterWindow.swift with uses of the CGEvent wrapper struct.
* Added argument label to call to CGEvent.init.
* Changed mouseLoc from piecewise assignment to assignment of the whole structure, as it is not yet initialized at that point.
* Linux platform channel: Refactored bump_mouse, setting the stage for a future Wayland implementation.
- Made a new top-level bump_mouse method in bump_mouse.cc/.h.
- Moved the X11-specific implementation to bump_mouse_x11 in bump_mouse_x11.cc/h.
Reworked the bumpMouse operation to have a boolean return value:
- Updated bumpMouse in platform_channel.dart to return a Future<bool> instead of a Future<void>.
- Windows platform channel: Updated BumpMouse in win32_desktop.cpp to return a bool value. Updated the method call handler "bumpMouse" branch in flutter_window.cpp to propagate the BumpMouse return value back to the originating MethodCall.
- MacOS platform channel: Updated the "bumpMouse" branch in the method call handler in MainFlutterWindow.swift to pass true or false into the 'result()' call.
- Linux platform channel: Updated the bump_mouse top-level method and its underlying implementation bump_mouse_x11 to return bool values. Updated the "bumpMouse" branch of host_channel_call_handler in my_application.cc to propagate the result value back up the method channel.
- Updated the kWindowBumpMouse branch of the method handler registered in desktop_home_page.dart to propagate a return value from RdplatformChannel.bumpMouse.
* Reworked the edge scrolling computations in model.dart to use Vector2 from the vector_math package. Updated pubspec.yaml to declare a dependency on vector_math.
* Added an alternative edge scrolling mechanism for when "Bump Mouse" functionality is unavailable:
- Added methods setEdgeScrollTimer and cancelEdgeScrollTimer to model.dart, along with a few state fields.
- Updated edgeScrollMouse to latch the (x, y) coordinate of the last edge scroll event, in case it will be autorepeating.
- Updated edgeScrollMouse to check whether the call to the kWindowBumpMouse method of rustDeskWinManager (and thus the underlying bump_mouse method) succeeded, and to switch to timer-based autorepeat if it fails. Made edgeScrollMouse async to allow awaiting the result of the kWindowBumpMouse method call.
- Updated input_model.dart to call cancelEdgeScrollTimer when a new move event is being processed.
- Updated remote_page.dart to call cancelEdgeScrollTimer when the pointer exits the area represented by the view.
* Fixed scroll percentage math in edgeScrollMouse in model.dart.
* Fixed declared return value for Win32Desktop::BumpMouse in win32_desktop.h.
* Fixed vector_math dependency version in pubspec.yaml to be compatible with the codebase standard Flutter version.
* Added class EdgeScrollFallbackState to model.dart for tracking the state of the edge scroll fallback strategy. Factored out the actual edge scrolling action from CanvasModel.edgeScrollMouse to new method performEdgeScroll so that EdgeScrollFallbackState can call it. Updated edgeScrollMouse to not call performEdgeScroll when it's enabling the fallback strategy.
Updated CanvasModel to use EdgeScrollFallbackState instead of directly tracking the state. Removed method setEdgeScrollTimer.
Added method initializeEdgeScrollFallback to CanvasModel that takes a TickerProvider. Updated _RemotePageState to include the mixin TickerProviderStateMixin. Updated _RemotePageState.initState to call canvasModel.initializeEdgeScrollFallback.
Updated handlePointerDevicePos in input_model.dart to not call cancelEdgeScrollTimer before edgeScrollMouse.
Renamed CanvasModel.cancelEdgeScrollTimer to CanvasModel.cancelEdgeScroll.
Updated the calculations in CanvasModel.edgeScrollMouse to only factor in the safe zone if BumpMouse is working. (Otherwise the problem with resizing can't possibly occur.)
* Updated CanvasModel.edgeScrollMouse in model.dart to handle the situation where only one of the scrollbars is active. Factored extraction of scrollbar data into new function getScrollInfo.
* Updated onWindowResize in tabbar_widget.dart to be resilient to RemotePage instances that don't yet have an ffi reference. Added property hasFFI to remote_page.dart.
* Removed debug output from model.dart.
* PR feedback:
- Added filtering to diagnostic output in the method handler in desktop_home_page.dart to exclude the very chatty kWindowBumpMouse-related output.
- Removed the diagnostic output from bumpMouse in platform_channel.dart for the same reason.
- Updated setScrollPercent to coalesce NaN values for x and y to 0.
- Initialized the GError pointer variable passed into fl_method_call_respond_success in linux/my_application.cc to NULL.
- Added bounds checking of the argument values in the EncodableList branch of the "bumpMouse" method call handler in windows/runner/flutter_window.cpp.
* Added a latch mechanism that keeps edge scrolling disabled until the cursor is observed to be in the inner area bounded by the edge scroll areas:
- Added tristate enumerated type EdgeScrollState to model.dart. In addition to inactive and active states, there is state armed which behaves like inactive but can transition to active when conditions are met.
- Added a field to CanvasModel of type EdgeScrollState. Added methods disableEdgeScroll and rearmEdgeScroll.
- Updated enterView to call canvasModel.rearmEdgeScroll and leaveView to call canvasModel.disableEdgeScroll in remote_page.dart.
- Updated edgeScrollMouse to check the state, disabling edge scrolling when the state is not active and transitioning from armed to active when the mouse is in the interior space.
- Removed the notifyResize/_suppressEdgeScroll mechanism from CanvasModel in model.dart as it is no longer necessary.
- Removed the "safe zone" mechanism from CanvasModel.edgeScrollMouse in model.dart as it is no longer necessary.
- Switched the onWindowResize handler in DesktopTabState in tabbar_widget.dart back to onWindowResized, now that it is no longer delivering canvasModel.notifyResize to all RemotePage tabs.
* Fixed memory leak: Added call to free GError object returned by Flutter API in the event of an error.
* PR feedback:
- Copilot: Use type annotations.
- Copilot: Condition to stop edge scrolling when fallback strategy is in use and the mouse is moved back to the centre.
- Copilot: Check FLValue type before calling fl_value_get_int.
- Copilot: Support list-style method channel dispatch in "bumpMouse" handler for macos as the linux and windows implementations already do.
- Naming convention for constants.
- Left-over variable from previous strategy: _suppressEdgeScroll.
- Unnecessary extra parentheses in edge scroll area conditions.
* Removed property suppressEdgeScroll referencing now-removed field _suppressEdgeScroll in model.dart.
Removed accidental extra blank line in MainFlutterWindow.swift.
* Switched CanvasModel.setScrollPercent to use double.isFinite instead of double.isNaN to test for proper numerical values.
* PR feedback:
- Copilot: Use Vector2.length2 instead of Vector2.length to avoid an unnecessary sqrt in comparison with zero.
- Copilot: Baleet unnecessary semicolons from Swift code.
* PR feedback:
- Copilot: Check argList.count before indexing it
* Oops with the semicolons again.
* Edge scroll, active local cursor
Signed-off-by: fufesou <linlong1266@gmail.com>
* Remove duplicated condition checks
Signed-off-by: fufesou <linlong1266@gmail.com>
* Chore
Signed-off-by: fufesou <linlong1266@gmail.com>
* PR feedback:
- Copilot: Removed unused property hasFFI from remote_page.dart.
- Copilot: Updated updateScrollStyle in model.dart to be resilient to the possibility of bind.sessionGetScrollStyle returning null.
* Factored local cursor updates out of CanvasModel.moveDesktopMouse in model.dart, adding new methods activateLocalCursor and updateLocalCursor.
Updated handlePointerDevicePos in input_model.dart to call canvasModel.updateLocalCursor on every mouse event.
Updated initState in remote_page.dart to schedule a call to canvasModel.activateLocalCursor as a first-image callback.
* Updated the explanation for rounding away from 0 in edgeScrollMouse in model.dart.
---------
Signed-off-by: Jonathan Gilbert <logic@deltaq.org>
Signed-off-by: fufesou <linlong1266@gmail.com>
Co-authored-by: fufesou <linlong1266@gmail.com>
* Added method equals to class LastWindowPosition to compare the contents of instances.
Added storage to common.dart for remembering what window position data has previously been written.
Factored the actual save code from saveWindowPosition to _saveWindowPositionActual and updated saveWindowPosition to call it through a debouncer, and only if the window position data has actually changed since the last call in the same instance.
Added named parameter 'flush' to saveWindowPosition in common.dart, and to _saveFrame in tabbar_widget.dart, and updated the onWindowClosed handler in tabbar_widget.dart to call _saveFrame with flush: true, forcing an immediate save on close.
Removed the _saveFrame debouncer from tabbar_widget.dart.
* saveWindowPosition: don't reschedule debounce if it's already in flight
* Reworked the logic in saveWindowPosition to collapse a rapid series of updates into one save at the end.
* feat(ui): custom scale mode with inline controls and live apply
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(dialog): remove unused showCustomScaleDialog function
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(ui): enhance custom scale controls with live updates and improved UI
- Introduced a reactive custom scale percentage using RxInt.
- Added initialization of custom scale from stored options after the widget builds.
- Updated viewStyle method to conditionally display custom controls based on selection.
- Implemented a debouncer for smoother scale adjustments.
- Enhanced slider UI with custom thumb shape and improved button interactions.
This update improves user experience by allowing real-time adjustments to the custom scale settings.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(remote_toolbar): improve widget lifecycle management and enhance slider dimensions
- Moved initialization of custom scale percentage to initState for better lifecycle handling.
- Updated slider thumb dimensions and layout for improved UI consistency.
- Added dispose method to clean up resources in custom scale controls.
These changes enhance the overall performance and user experience of the remote toolbar.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(remote_toolbar): enhance scroll behavior and improve slider thumb rendering
- Introduced a new state variable to manage scroll enablement based on canvas model changes.
- Updated the return value of the viewStyle method to include the scroll enablement status.
- Refactored the slider thumb shape for better performance and visual consistency.
- Improved the initialization of image overflow detection in the CanvasModel.
These changes enhance the user experience by providing dynamic scroll control and a more responsive UI.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(scale): introduce utility functions for custom scale management for DRY
- Added a new file `scale.dart` containing utility functions to clamp, parse, and compute custom scale percentages.
- Refactored the `CanvasModel` and `_DisplayMenuState` to utilize the new utility functions for fetching and applying custom scale settings.
- Improved code readability and maintainability by centralizing scale-related logic.
These changes enhance the handling of custom scale settings across the application.
Signed-off-by: Alessandro De Blasis alex@deblasis.net
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/utils/scale.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore: Remove unused import of 'uuid' in scale.dart
Signed-off-by: Alessandro De Blasis alex@deblasis.net
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(remote_toolbar): implement nonlinear mapping for custom scale slider
- Added piecewise mapping functions to convert normalized slider positions to custom scale percentages and vice versa.
- Introduced snapping behavior for the slider to enhance user experience.
- Updated the slider's minimum and maximum values to align with the new mapping logic.
- Adjusted the clamping function to ensure the minimum percentage is 10.
These changes improve the precision and usability of the custom scale slider in the remote toolbar.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* fix(scale): update minimum scale percentage to 5
- Adjusted the minimum scale percentage in both the remote toolbar and the clamping function to improve consistency and usability.
- This change aligns the clamping logic with the updated minimum value for the custom scale slider.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* refactor(scale): centralize custom scale constants in consts.dart
- Moved piecewise mapping constants for the custom scale slider from the remote toolbar to consts.dart for better organization and maintainability.
- Introduced additional constants related to custom scale behavior, including minimum, pivot, and maximum percentages, as well as debounce duration.
- Updated the remote toolbar to reference these centralized constants, improving code clarity and reducing duplication.
These changes enhance the structure and readability of the custom scale implementation.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(consts): remove duplicate custom scale percent key definition
- Eliminated redundant declaration of the custom scale percent key in consts.dart, ensuring a single source of truth for this constant.
- This change improves code clarity and maintainability by reducing duplication.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(scale): update clamping logic to use centralized constants
- Modified the clamping function to utilize the newly defined constants for minimum and maximum scale percentages, enhancing code maintainability and clarity.
- This change ensures consistency across the application by referencing a single source for scale limits.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Enhance RdoMenuButton behavior for custom scale selection
- Updated the RdoMenuButton to include a new `closeOnActivate` parameter, allowing the submenu to remain open when selecting custom scale options.
- Modified the onChanged callback to conditionally trigger a rebuild when entering custom mode, improving user experience by immediately displaying the slider controls.
These changes streamline the interaction with the custom scale feature in the remote toolbar.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(toolbar): _DisplayMenuState to simplify scroll handling
- Removed the _scrollEnabled state variable and its associated logic, streamlining the component's state management.
- Updated the RdoMenuButton onChanged callbacks to directly reference the canvasModel's imageOverflow value, enhancing responsiveness and reducing complexity.
These changes improve code clarity and maintainability in the remote toolbar's display menu.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(lang): Add translations for custom scale features in multiple languages
- Introduced new entries for "Scale custom", "Custom scale slider", "Decrease", and "Increase" in various language files to support the custom scale functionality.
- This update enhances the localization of the application, ensuring users can interact with the custom scale features in their preferred language.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* feat(lang): Add translations for custom scale features in Catalan and Romanian
- Updated language files for Catalan and Romanian to include translations for "Custom scale slider", "Decrease", and "Increase".
- This enhancement improves the localization of the application, allowing users to interact with custom scale features in their native languages.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* fix(model): Correct error logging in getSessionCustomScale method
- Updated the error logging statement in the getSessionCustomScale method to properly interpolate the exception message, improving debugging clarity.
- This change ensures that error messages are more informative, aiding in troubleshooting issues related to session scaling.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(scale): Simplify clamping logic for custom scale percent
- Updated the clampCustomScalePercent function to use the built-in clamp method, improving code readability and maintainability.
- This change ensures consistent clamping behavior across the application by centralizing the logic for valid scale ranges.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(scale): Remove unused import for web bridge
- Eliminated the conditional import of the web bridge from scale.dart, as it is no longer necessary. This change helps to clean up the code and improve maintainability by removing unused dependencies.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* chore(model): typo
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* chore(toolbar): Clarify precision for scale adjustments in remote toolbar
- Added comments to clarify the use of a wide range of divisions for the scale slider, allowing for ~1% precision increments. This change improves user experience by enabling more precise scale value settings, reducing the need for fine-tuning with +/- buttons.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/models/model.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* fix(model): Enhance error logging in getSessionCustomScale method
- Improved error logging by adding stack trace output to debugPrintStack, enhancing debugging capabilities for session scaling issues.
- This change provides clearer insights into errors encountered during scale retrieval, aiding in troubleshooting.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* refactor(toolbar): Simplify custom scale percent retrieval in remote toolbar
- Replaced the previous method of retrieving the custom scale percent with a new function, getSessionCustomScalePercent, enhancing code clarity and maintainability.
- This change streamlines the process of obtaining the scale value, ensuring a more efficient and readable implementation.
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
* Update flutter/lib/desktop/widgets/remote_toolbar.dart
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Signed-off-by: Alessandro De Blasis <alex@deblasis.net>
Signed-off-by: Alessandro De Blasis alex@deblasis.net
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: RustDesk <71636191+rustdesk@users.noreply.github.com>
* Added win32_desktop.cpp/.h defining a method Win32Desktop::GetWorkArea.
Added code to wWinMain in main.cpp to position the window relative to the work area, which may not be at (0, 0) depending on the user's configuration.
* Corrected the constraint on the size value calculated by main.cpp.
* Fixed references to min to use std::min.
* Reworked GetWorkArea in win32_desktop.cpp to treat the supplied origin and size as containing an existing window rectangle, and to find the monitor that contains or is closest to that window.
Added function FitToWorkArea to win32_desktop.cpp/.h.
Updated main.cpp to use Win32Desktop::FitToWorkArea instead of explicitly constraining the size.