@@ -36,6 +36,7 @@ public partial class MainWindow : Window
36
36
private Headlines _headlines ;
37
37
private BitmapImage [ ] _bannerBitmaps ;
38
38
private int _currentBannerIndex ;
39
+ private bool _everShown = false ;
39
40
40
41
class BannerDotInfo
41
42
{
@@ -184,7 +185,7 @@ private async Task SetupHeadlines()
184
185
}
185
186
}
186
187
187
- private const int CURRENT_VERSION_LEVEL = 1 ;
188
+ private const int CURRENT_VERSION_LEVEL = 2 ;
188
189
189
190
private void SetDefaults ( )
190
191
{
@@ -242,6 +243,11 @@ private void SetDefaults()
242
243
243
244
break ;
244
245
246
+ // 5.12.2022: Bad main window placement when using auto-launch
247
+ case 1 :
248
+ App . Settings . MainWindowPlacement = null ;
249
+ break ;
250
+
245
251
default :
246
252
throw new ArgumentOutOfRangeException ( ) ;
247
253
}
@@ -344,6 +350,8 @@ public void Initialize()
344
350
345
351
Show ( ) ;
346
352
Activate ( ) ;
353
+
354
+ _everShown = true ;
347
355
}
348
356
349
357
private void BannerCard_MouseUp ( object sender , MouseButtonEventArgs e )
@@ -598,6 +606,9 @@ private void SettingsControl_OnCloseMainWindowGracefully(object sender, EventArg
598
606
599
607
private void MainWindow_OnClosing ( object sender , CancelEventArgs e )
600
608
{
609
+ if ( ! _everShown )
610
+ return ;
611
+
601
612
try
602
613
{
603
614
PreserveWindowPosition . SaveWindowPosition ( this ) ;
@@ -613,6 +624,11 @@ protected override void OnSourceInitialized(EventArgs e)
613
624
try
614
625
{
615
626
PreserveWindowPosition . RestorePosition ( this ) ;
627
+
628
+ // Restore the size of the window to what we expect it to be
629
+ // There's no better way to do it that doesn't make me wanna off myself
630
+ Width = 845 ;
631
+ Height = 376 ;
616
632
}
617
633
catch ( Exception ex )
618
634
{
0 commit comments