File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . ComponentModel ;
3+ using System . Diagnostics ;
34using System . Runtime . CompilerServices ;
45using System . Windows . Forms ;
56using 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 {
You can’t perform that action at this time.
0 commit comments