summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2016-11-22 12:02:49 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2016-11-22 12:02:49 -0800
commita39f6e9b4c3ccba677f58f3c0aafe9e6186c3031 (patch)
treec2d28c77de453b564dd4eb01f511b3f42193f7f2
parentadb7a888362b8e37d9dacb48edfa97e3803687ee (diff)
downloadinfinitytier-a39f6e9b4c3ccba677f58f3c0aafe9e6186c3031.tar.gz
infinitytier-a39f6e9b4c3ccba677f58f3c0aafe9e6186c3031.zip
clear cached window positions when display settings change
-rw-r--r--windows/WinUI/ToolbarItem.xaml.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/windows/WinUI/ToolbarItem.xaml.cs b/windows/WinUI/ToolbarItem.xaml.cs
index 5e8dd9f5..6ecac6c2 100644
--- a/windows/WinUI/ToolbarItem.xaml.cs
+++ b/windows/WinUI/ToolbarItem.xaml.cs
@@ -19,6 +19,7 @@ using System.Timers;
using System.Windows.Threading;
using System.IO;
using System.Diagnostics;
+using Microsoft.Win32;
namespace WinUI
{
@@ -57,6 +58,8 @@ namespace WinUI
mon.SubscribeNetworkUpdates(updateNetworks);
mon.SubscribeStatusUpdates(updateStatus);
+
+ SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged);
}
~ToolbarItem()
@@ -276,5 +279,18 @@ namespace WinUI
w.Top = top;
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;
+ }
}
}