Merge pull request #2188 from Trellmor/UpdateSessionDisplaySettings

Update session display settings
This commit is contained in:
Dimitrij
2022-03-19 12:57:09 +00:00
committed by GitHub
5 changed files with 53 additions and 27 deletions

View File

@@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Added
- #2138: Improve compatibility with Remote Desktop Connection Manager v2.83
- #2123: Thycotic Secret Server - Added 2FA OTP support
### Changed
- #1546: Enable resize without reconnect for RDP Version Rdc9 or higher
## [1.77.2]
### Added

View File

@@ -29,7 +29,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
protected set
{
base.SmartSize = value;
ReconnectForResize();
DoResizeClient();
}
}
@@ -39,7 +39,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
protected set
{
base.Fullscreen = value;
ReconnectForResize();
DoResizeClient();
}
}
@@ -50,19 +50,19 @@ namespace mRemoteNG.Connection.Protocol.RDP
public override void Resize(object sender, EventArgs e)
{
if (DoResize() && _controlBeginningSize.IsEmpty)
if (DoResizeControl() && _controlBeginningSize.IsEmpty)
{
ReconnectForResize();
DoResizeClient();
}
base.Resize(sender, e);
}
public override void ResizeEnd(object sender, EventArgs e)
{
DoResize();
DoResizeControl();
if (!(Control.Size == _controlBeginningSize))
{
ReconnectForResize();
DoResizeClient();
}
_controlBeginningSize = Size.Empty;
}
@@ -72,7 +72,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
return new AxMsRdpClient8NotSafeForScripting();
}
private void ReconnectForResize()
private void DoResizeClient()
{
if (!loginComplete)
return;
@@ -94,8 +94,8 @@ namespace mRemoteNG.Connection.Protocol.RDP
{
var size = Fullscreen
? Screen.FromControl(Control).Bounds.Size
: Control.Size;
RdpClient8.Reconnect((uint)size.Width, (uint)size.Height);
: Control.Size;
UpdateSessionDisplaySettings((uint)size.Width, (uint)size.Height);
}
catch (Exception ex)
{
@@ -106,7 +106,7 @@ namespace mRemoteNG.Connection.Protocol.RDP
}
}
private bool DoResize()
private bool DoResizeControl()
{
Control.Location = InterfaceControl.Location;
// kmscode - this doesn't look right to me. But I'm not aware of any functionality issues with this currently...
@@ -120,5 +120,10 @@ namespace mRemoteNG.Connection.Protocol.RDP
return false;
}
}
protected virtual void UpdateSessionDisplaySettings(uint width, uint height)
{
RdpClient8.Reconnect(width, height);
}
}
}

View File

@@ -1,15 +1,24 @@
using System.Windows.Forms;
using AxMSTSCLib;
namespace mRemoteNG.Connection.Protocol.RDP
{
public class RdpProtocol9 : RdpProtocol8
{
protected override RdpVersion RdpProtocolVersion => RdpVersion.Rdc9;
protected override AxHost CreateActiveXRdpClientControl()
{
return new AxMsRdpClient9NotSafeForScripting();
}
}
}
using System.Windows.Forms;
using AxMSTSCLib;
using MSTSCLib;
namespace mRemoteNG.Connection.Protocol.RDP
{
public class RdpProtocol9 : RdpProtocol8
{
private MsRdpClient9NotSafeForScripting RdpClient9 =>
(MsRdpClient9NotSafeForScripting)((AxHost)Control).GetOcx();
protected override RdpVersion RdpProtocolVersion => RdpVersion.Rdc9;
protected override AxHost CreateActiveXRdpClientControl()
{
return new AxMsRdpClient9NotSafeForScripting();
}
protected override void UpdateSessionDisplaySettings(uint width, uint height)
{
RdpClient9.UpdateSessionDisplaySettings(width, height, width, height, 0, 1, 1);
}
}
}

View File

@@ -121,10 +121,11 @@ the following connection options are set:
To prevent reconnecting, you can do one of several things:
- Change RDP Version to Rdc9 or higher. Rdc9 supports resolution changes without reconnecting.
- Change the resolution to Smart Size. This will scale the original connection area when the view window size changes. This does not preserve aspect ratio.
- Turn off Automatic Resize. When the view window size changes, you will see scroll bars or dead space.
There is no way to update the view window size without a reconnect.
There is no way to update the view window size without a reconnect in RDP Version lower than Rdc9.
This is an RDP protocol limitation.
AltGr key combinations stop working in other apps when connected to RDP

View File

@@ -118,7 +118,16 @@ In RDP 8, support was improved for reconnecting RDP connections for resizing ope
RDP 9
-----
We support this protocol version, but are not yet using any of its features.
In RDP 9, support was further improved for reconnecting RDP connections for resizing operations.
.. list-table::
:widths: 30 70
:header-rows: 1
* - Property
- Description
* - Automatic Resize
- When this property is enabled and ``Resolution`` is set to ``Fit to Panel`` and the connection window is resized, the RDP connection will automatically change the resolution without reconnecting.
RDP 10