@@ -64,6 +64,7 @@ private void OnInitialized(object sender, EventArgs e)
64
64
65
65
private void OnLoaded ( object sender , RoutedEventArgs _ )
66
66
{
67
+ HideStartup ( ) ;
67
68
// show notify icon when flowlauncher is hidden
68
69
InitializeNotifyIcon ( ) ;
69
70
WindowsInteropHelper . DisableControlBox ( this ) ;
@@ -335,6 +336,8 @@ private void UpdatePosition()
335
336
{
336
337
Left = WindowLeft ( ) ;
337
338
Top = WindowTop ( ) ;
339
+ _settings . WindowLeft = Left ;
340
+ _settings . WindowTop = Top ;
338
341
}
339
342
}
340
343
@@ -350,7 +353,27 @@ private void OnLocationChanged(object sender, EventArgs e)
350
353
}
351
354
}
352
355
353
- private double WindowLeft ( )
356
+ public void HideStartup ( )
357
+ {
358
+ if ( _settings . HideOnStartup )
359
+ {
360
+ _viewModel . Hide ( ) ;
361
+ }
362
+ else
363
+ {
364
+ if ( ! _settings . HideOnStartup && _settings . WindowLeft == 0 && _settings . WindowTop == 0 ) /* First Launch */
365
+ {
366
+ Left = WindowLeft ( ) ;
367
+ Top = WindowTop ( ) ;
368
+ _settings . WindowLeft = Left ;
369
+ _settings . WindowTop = Top ;
370
+ }
371
+ _viewModel . Show ( ) ;
372
+ }
373
+
374
+ }
375
+
376
+ public double WindowLeft ( )
354
377
{
355
378
var screen = Screen . FromPoint ( System . Windows . Forms . Cursor . Position ) ;
356
379
var dip1 = WindowsInteropHelper . TransformPixelsToDIP ( this , screen . WorkingArea . X , 0 ) ;
@@ -359,7 +382,7 @@ private double WindowLeft()
359
382
return left ;
360
383
}
361
384
362
- private double WindowTop ( )
385
+ public double WindowTop ( )
363
386
{
364
387
var screen = Screen . FromPoint ( System . Windows . Forms . Cursor . Position ) ;
365
388
var dip1 = WindowsInteropHelper . TransformPixelsToDIP ( this , 0 , screen . WorkingArea . Y ) ;
0 commit comments