Skip to content

Commit 9343b22

Browse files
committed
fix: Incorrect size when restoring a minimized and disconnected RDP.
close #913
1 parent e81142e commit 9343b22

File tree

5 files changed

+10
-11
lines changed

5 files changed

+10
-11
lines changed

Ui/AppVersion.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ public static class AppVersion
66
{
77
public const uint Major = 1;
88
public const uint Minor = 2;
9-
public const uint Patch = 0;
9+
public const uint Patch = 1;
1010
public const uint Build = 0;
1111
public const string BuildDate = "";
12-
public const string PreRelease = ""; // e.g. "alpha" "beta.2"
12+
public const string PreRelease = "alpha"; // e.g. "alpha" "beta.2"
1313

1414
public static readonly Version VersionData = new Version(Major, Minor, Patch, Build, PreRelease);
1515
public static string Version => VersionData.ToString();

Ui/View/Host/ProtocolHosts/AxMsRdpClient09Host.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -785,16 +785,16 @@ public override IntPtr GetHostHwnd()
785785

786786
public override bool CanResizeNow()
787787
{
788-
return Status == ProtocolHostStatus.Connected;
788+
return Status == ProtocolHostStatus.Connected || Status == ProtocolHostStatus.Disconnected;
789789
}
790790

791791
#endregion Base Interface
792792

793793

794794
#region WindowOnResizeEnd
795795

796-
private readonly System.Timers.Timer _resizeEndTimer = new(500) { Enabled = false, AutoReset = false };
797-
private readonly object _resizeEndLocker = new();
796+
private readonly Timer _resizeEndTimer = new Timer(500) { Enabled = false, AutoReset = false };
797+
private readonly Lock _resizeEndLocker = new Lock();
798798
private bool _canAutoResizeByWindowSizeChanged = true;
799799

800800
/// <summary>

Ui/View/Host/ProtocolHosts/HostBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ public enum ProtocolHostStatus
1919
Initializing,
2020
Initialized,
2121
Connecting,
22+
WaitingForReconnect,
2223
Connected,
2324
Disconnected,
24-
WaitingForReconnect
2525
}
2626

2727
public enum ProtocolHostType

Ui/View/Host/TabWindowView.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ public TabWindowView()
5353
{
5454
if (this.WindowState == WindowState.Normal)
5555
{
56-
IoC.Get<LocalityService>().TabWindowHeight = this.Height;
57-
IoC.Get<LocalityService>().TabWindowWidth = this.Width;
56+
IoC.Get<LocalityService>().TabWindowWidth = this.ActualWidth;
57+
IoC.Get<LocalityService>().TabWindowHeight = this.ActualHeight;
5858
}
59-
SimpleLogHelper.Debug($"Tab size change to:W = {this.Width}, H = {this.Height}");
59+
SimpleLogHelper.DebugInfo($"(Window size changed) Tab size change to:W = {this.ActualWidth}, H = {this.ActualHeight}");
6060
};
6161

6262
// remember window pos when size changed
@@ -81,7 +81,7 @@ public TabWindowView()
8181
}
8282
Vm?.SelectedItem?.Content?.ToggleAutoResize(true);
8383
IoC.Get<LocalityService>().TabWindowState = this.WindowState;
84-
SimpleLogHelper.Debug($"(Window state changed)Tab size change to:W = {this.Width}, H = {this.Height}");
84+
SimpleLogHelper.DebugInfo($"(Window state changed) Tab size change to:W = {this.ActualWidth}, H = {this.ActualHeight}");
8585
};
8686

8787

Ui/View/Host/TabWindowViewModel.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ public RelayCommand CmdGoMaximize
240240
{
241241
View.WindowState = WindowState.Maximized;
242242
}
243-
244243
else
245244
{
246245
View.WindowStyle = WindowStyle.SingleBorderWindow;

0 commit comments

Comments
 (0)