@@ -29,6 +29,7 @@ public partial class MainWindow
29
29
private NotifyIcon _notifyIcon ;
30
30
private ContextMenu contextMenu ;
31
31
private MainViewModel _viewModel ;
32
+ private bool _animating ;
32
33
33
34
#endregion
34
35
@@ -37,8 +38,8 @@ public MainWindow(Settings settings, MainViewModel mainVM)
37
38
DataContext = mainVM ;
38
39
_viewModel = mainVM ;
39
40
_settings = settings ;
40
- InitializePosition ( ) ;
41
41
InitializeComponent ( ) ;
42
+ InitializePosition ( ) ;
42
43
}
43
44
44
45
public MainWindow ( )
@@ -180,7 +181,7 @@ private void InitializeNotifyIcon()
180
181
181
182
var header = new MenuItem
182
183
{
183
- Header = "Flow Launcher" ,
184
+ Header = "Flow Launcher" ,
184
185
IsEnabled = false
185
186
} ;
186
187
var open = new MenuItem
@@ -237,6 +238,10 @@ private void InitProgressbarAnimation()
237
238
238
239
public void WindowAnimator ( )
239
240
{
241
+ if ( _animating )
242
+ return ;
243
+
244
+ _animating = true ;
240
245
UpdatePosition ( ) ;
241
246
Storyboard sb = new Storyboard ( ) ;
242
247
var da = new DoubleAnimation
@@ -269,6 +274,7 @@ public void WindowAnimator()
269
274
sb . Children . Add ( da ) ;
270
275
sb . Children . Add ( da2 ) ;
271
276
sb . Children . Add ( da3 ) ;
277
+ sb . Completed += ( _ , _ ) => _animating = false ;
272
278
sb . Begin ( FlowMainWindow ) ;
273
279
}
274
280
@@ -322,6 +328,9 @@ private void OnDeactivated(object sender, EventArgs e)
322
328
323
329
private void UpdatePosition ( )
324
330
{
331
+ if ( _animating )
332
+ return ;
333
+
325
334
if ( _settings . RememberLastLaunchLocation )
326
335
{
327
336
Left = _settings . WindowLeft ;
@@ -337,6 +346,8 @@ private void UpdatePosition()
337
346
338
347
private void OnLocationChanged ( object sender , EventArgs e )
339
348
{
349
+ if ( _animating )
350
+ return ;
340
351
if ( _settings . RememberLastLaunchLocation )
341
352
{
342
353
_settings . WindowLeft = Left ;
0 commit comments