diff --git a/SafeExamBrowser.Runtime.UnitTests/Operations/KioskModeOperationTests.cs b/SafeExamBrowser.Runtime.UnitTests/Operations/KioskModeOperationTests.cs index 1b85d9d5..9ac349ac 100644 --- a/SafeExamBrowser.Runtime.UnitTests/Operations/KioskModeOperationTests.cs +++ b/SafeExamBrowser.Runtime.UnitTests/Operations/KioskModeOperationTests.cs @@ -168,7 +168,7 @@ namespace SafeExamBrowser.Runtime.UnitTests.Operations explorerShell.Verify(s => s.Resume(), Times.Once); explorerShell.Verify(s => s.Terminate(), Times.Once); - explorerShell.Verify(s => s.Suspend(), Times.Once); + explorerShell.Verify(s => s.Suspend(), Times.Exactly(2)); explorerShell.Verify(s => s.Start(), Times.Once); newDesktop.Verify(d => d.Activate(), Times.Exactly(2)); newDesktop.Verify(d => d.Close(), Times.Once); diff --git a/SafeExamBrowser.UserInterface.Classic/RuntimeWindow.xaml.cs b/SafeExamBrowser.UserInterface.Classic/RuntimeWindow.xaml.cs index 9e813a21..decad95d 100644 --- a/SafeExamBrowser.UserInterface.Classic/RuntimeWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Classic/RuntimeWindow.xaml.cs @@ -44,6 +44,8 @@ namespace SafeExamBrowser.UserInterface.Classic InitializeComponent(); InitializeRuntimeWindow(); + + Loaded += RuntimeWindow_Loaded; } public void BringToForeground() @@ -141,5 +143,11 @@ namespace SafeExamBrowser.UserInterface.Classic Closing += (o, args) => args.Cancel = !allowClose; } + + private void RuntimeWindow_Loaded(object sender, RoutedEventArgs e) + { + Left = (SystemParameters.WorkArea.Right / 2) - (Width / 2); + Top = (SystemParameters.WorkArea.Bottom / 2) - (Height / 2); + } } } diff --git a/SafeExamBrowser.UserInterface.Classic/SplashScreen.xaml.cs b/SafeExamBrowser.UserInterface.Classic/SplashScreen.xaml.cs index 3b39f208..7e841f7c 100644 --- a/SafeExamBrowser.UserInterface.Classic/SplashScreen.xaml.cs +++ b/SafeExamBrowser.UserInterface.Classic/SplashScreen.xaml.cs @@ -49,6 +49,8 @@ namespace SafeExamBrowser.UserInterface.Classic InitializeComponent(); InitializeSplashScreen(); + + Loaded += SplashScreen_Loaded; } public void BringToForeground() @@ -134,5 +136,11 @@ namespace SafeExamBrowser.UserInterface.Classic InfoTextBlock.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10 }); } } + + private void SplashScreen_Loaded(object sender, RoutedEventArgs e) + { + Left = (SystemParameters.WorkArea.Right / 2) - (Width / 2); + Top = (SystemParameters.WorkArea.Bottom / 2) - (Height / 2); + } } }