Skip to content

Commit 7306e7e

Browse files
committed
Fix: #3183
1 parent e832246 commit 7306e7e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

Source/NETworkManager/StatusWindow.xaml.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.ComponentModel;
3+
using System.Diagnostics;
34
using System.Runtime.CompilerServices;
45
using System.Windows.Forms;
56
using System.Windows.Input;
@@ -43,7 +44,7 @@ private void OnPropertyChanged([CallerMemberName] string propertyName = null)
4344
#endregion
4445

4546
#region Variables
46-
47+
4748
// Set priority to make the ui smoother
4849
private readonly DispatcherTimer _dispatcherTimerClose = new(DispatcherPriority.Normal);
4950

@@ -142,16 +143,18 @@ public void ShowWindow(bool enableCloseTimer = false)
142143
// ToDo: User setting...
143144
if (Screen.PrimaryScreen != null)
144145
{
145-
Left = Screen.PrimaryScreen.WorkingArea.Right - Width - 10;
146-
Top = Screen.PrimaryScreen.WorkingArea.Bottom - Height - 10;
146+
var scaleFactor = System.Windows.Media.VisualTreeHelper.GetDpi(this).DpiScaleX;
147+
148+
Left = Screen.PrimaryScreen.WorkingArea.Right / scaleFactor - Width - 10;
149+
Top = Screen.PrimaryScreen.WorkingArea.Bottom / scaleFactor - Height - 10;
147150
}
148151

149152
// Show the window
150153
Show();
151-
154+
152155
// Check the network connection
153156
Check();
154-
157+
155158
// Close the window after a certain time
156159
if (enableCloseTimer)
157160
{

0 commit comments

Comments
 (0)