mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Update IntegratedProgram and PowerShell protocols to respect connection frame padding
Co-authored-by: Kvarkas <3611964+Kvarkas@users.noreply.github.com>
This commit is contained in:
@@ -139,10 +139,13 @@ namespace mRemoteNG.Connection.Protocol
|
||||
try
|
||||
{
|
||||
if (InterfaceControl.Size == Size.Empty) return;
|
||||
NativeMethods.MoveWindow(_handle, -SystemInformation.FrameBorderSize.Width,
|
||||
-(SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height),
|
||||
InterfaceControl.Width + SystemInformation.FrameBorderSize.Width * 2,
|
||||
InterfaceControl.Height + SystemInformation.CaptionHeight +
|
||||
// Use ClientRectangle to account for padding (for connection frame color)
|
||||
Rectangle clientRect = InterfaceControl.ClientRectangle;
|
||||
NativeMethods.MoveWindow(_handle,
|
||||
clientRect.X - SystemInformation.FrameBorderSize.Width,
|
||||
clientRect.Y - (SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height),
|
||||
clientRect.Width + SystemInformation.FrameBorderSize.Width * 2,
|
||||
clientRect.Height + SystemInformation.CaptionHeight +
|
||||
SystemInformation.FrameBorderSize.Height * 2, true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@@ -229,10 +229,13 @@ namespace mRemoteNG.Connection.Protocol.PowerShell
|
||||
try
|
||||
{
|
||||
if (InterfaceControl.Size == Size.Empty) return;
|
||||
NativeMethods.MoveWindow(_handle, -SystemInformation.FrameBorderSize.Width,
|
||||
-(SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height),
|
||||
InterfaceControl.Width + SystemInformation.FrameBorderSize.Width * 2,
|
||||
InterfaceControl.Height + SystemInformation.CaptionHeight +
|
||||
// Use ClientRectangle to account for padding (for connection frame color)
|
||||
Rectangle clientRect = InterfaceControl.ClientRectangle;
|
||||
NativeMethods.MoveWindow(_handle,
|
||||
clientRect.X - SystemInformation.FrameBorderSize.Width,
|
||||
clientRect.Y - (SystemInformation.CaptionHeight + SystemInformation.FrameBorderSize.Height),
|
||||
clientRect.Width + SystemInformation.FrameBorderSize.Width * 2,
|
||||
clientRect.Height + SystemInformation.CaptionHeight +
|
||||
SystemInformation.FrameBorderSize.Height * 2, true);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
Reference in New Issue
Block a user