Skip to content

Conversation

@BornToBeRoot
Copy link
Owner

@BornToBeRoot BornToBeRoot commented Dec 29, 2024

Changes proposed in this pull request

  • Use per Monitor DPI to scale RDP session
  • Use DesktopScaleFactor & DeviceScaleFactor
  • Use UpdateSessionDisplaySettings instead of Reconnect()

Known issues / to do

  • When connecting with a fixed size... the control (not the session) doesn't size correct:
Screenshot

image

Related issue(s)

Copilot generated summary

Provide a Copilot generated summary of the changes in this pull request.

Copilot summary

This pull request includes several improvements to the RemoteDesktopControl component in the NETworkManager project. The changes focus on enhancing DPI scaling support, improving screen adjustment logic, and updating dependencies.

Enhancements to DPI scaling and screen adjustment:

  • Added WindowsFormsHost_DpiChanged event handler in RemoteDesktopControl.xaml to handle DPI changes dynamically.
  • Introduced methods GetDesktopScaleFactor, GetDeviceScaleFactor, and GetDpiScaleFactor to calculate appropriate scaling factors based on DPI in RemoteDesktopControl.xaml.cs.
  • Updated the Connect, Reconnect, and AdjustScreen methods to apply DPI scaling factors and adjust the screen size accordingly. [1] [2] [3]

Dependency updates:

  • Replaced AxMsRdpClient9NotSafeForScripting with AxMsRdpClient10NotSafeForScripting in RemoteDesktopControl.xaml to use a more recent version of the RDP client.

Logging and debugging improvements:

  • Added log4net logging to RemoteDesktopControl.xaml.cs for better error tracking and debugging.

These changes collectively improve the handling of high-DPI displays and ensure that the remote desktop control adjusts its size and scaling dynamically based on the current DPI settings.

To-Do

Contributing

By submitting this pull request, I confirm the following:

@BornToBeRoot BornToBeRoot added this to the next-release milestone Dec 29, 2024
@mergify mergify bot merged commit e7116f6 into main Dec 31, 2024
4 checks passed
@mergify mergify bot deleted the fix/2911 branch December 31, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants