mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 12:33:44 +02:00
clear cached window positions when display settings change
This commit is contained in:
parent
adb7a88836
commit
a39f6e9b4c
1 changed files with 16 additions and 0 deletions
|
@ -19,6 +19,7 @@ using System.Timers;
|
||||||
using System.Windows.Threading;
|
using System.Windows.Threading;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using Microsoft.Win32;
|
||||||
|
|
||||||
namespace WinUI
|
namespace WinUI
|
||||||
{
|
{
|
||||||
|
@ -57,6 +58,8 @@ namespace WinUI
|
||||||
|
|
||||||
mon.SubscribeNetworkUpdates(updateNetworks);
|
mon.SubscribeNetworkUpdates(updateNetworks);
|
||||||
mon.SubscribeStatusUpdates(updateStatus);
|
mon.SubscribeStatusUpdates(updateStatus);
|
||||||
|
|
||||||
|
SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
~ToolbarItem()
|
~ToolbarItem()
|
||||||
|
@ -276,5 +279,18 @@ namespace WinUI
|
||||||
w.Top = top;
|
w.Top = top;
|
||||||
w.Left = left;
|
w.Left = left;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void SystemEvents_DisplaySettingsChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
// reset cached locations to (0, 0) when display size changes
|
||||||
|
netListLocation.X = 0;
|
||||||
|
netListLocation.Y = 0;
|
||||||
|
joinNetLocation.X = 0;
|
||||||
|
joinNetLocation.Y = 0;
|
||||||
|
aboutViewLocation.X = 0;
|
||||||
|
aboutViewLocation.Y = 0;
|
||||||
|
prefsViewLocation.X = 0;
|
||||||
|
prefsViewLocation.Y = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue