Skip to content

Commit a9a1c21

Browse files
committed
- remove 'using system.diagnotics'
- fix positioning
1 parent f4e5bf4 commit a9a1c21

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
ResizeMode="CanResize"
2727
StateChanged="Window_StateChanged"
2828
Top="{Binding SettingWindowTop, Mode=TwoWay}"
29-
WindowStartupLocation="CenterScreen"
29+
WindowStartupLocation="Manual"
3030
mc:Ignorable="d">
3131
<WindowChrome.WindowChrome>
3232
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Microsoft.Win32;
1313
using ModernWpf;
1414
using System;
15-
using System.Diagnostics;
1615
using System.IO;
1716
using System.Windows;
1817
using System.Windows.Controls;
@@ -38,9 +37,10 @@ public partial class SettingWindow
3837

3938
public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
4039
{
41-
InitializeComponent();
4240
settings = viewModel.Settings;
4341
DataContext = viewModel;
42+
InitializeComponent();
43+
InitializePosition();
4444
this.viewModel = viewModel;
4545
API = api;
4646
}
@@ -49,13 +49,13 @@ public SettingWindow(IPublicAPI api, SettingWindowViewModel viewModel)
4949

5050
private void OnLoaded(object sender, RoutedEventArgs e)
5151
{
52-
InitializePosition();
5352
RefreshMaximizeRestoreButton();
5453
// Fix (workaround) for the window freezes after lock screen (Win+L)
5554
// https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf
5655
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
5756
HwndTarget hwndTarget = hwndSource.CompositionTarget;
5857
hwndTarget.RenderMode = RenderMode.SoftwareOnly;
58+
InitializePosition();
5959
}
6060

6161
private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)