SEBWIN-716, #323: Fixed issue where password dialog was visible but not having input focus during application startup.

This commit is contained in:
Damian Büchel 2023-07-25 14:14:05 +02:00
parent 27f2fde904
commit 0769cf6b4b
7 changed files with 27 additions and 16 deletions

View file

@ -17,7 +17,7 @@ namespace SafeExamBrowser.Runtime
public class App : Application
{
private static readonly Mutex Mutex = new Mutex(true, AppConfig.RUNTIME_MUTEX_NAME);
private CompositionRoot instances = new CompositionRoot();
private readonly CompositionRoot instances = new CompositionRoot();
[STAThread]
public static void Main()

View file

@ -31,19 +31,19 @@ namespace SafeExamBrowser.Runtime
{
internal class RuntimeController
{
private AppConfig appConfig;
private ILogger logger;
private IMessageBox messageBox;
private IOperationSequence bootstrapSequence;
private IRepeatableOperationSequence sessionSequence;
private IRuntimeHost runtimeHost;
private IRuntimeWindow runtimeWindow;
private IServiceProxy service;
private SessionContext sessionContext;
private ISplashScreen splashScreen;
private Action shutdown;
private IText text;
private IUserInterfaceFactory uiFactory;
private readonly AppConfig appConfig;
private readonly ILogger logger;
private readonly IMessageBox messageBox;
private readonly IOperationSequence bootstrapSequence;
private readonly IRepeatableOperationSequence sessionSequence;
private readonly IRuntimeHost runtimeHost;
private readonly IRuntimeWindow runtimeWindow;
private readonly IServiceProxy service;
private readonly SessionContext sessionContext;
private readonly ISplashScreen splashScreen;
private readonly Action shutdown;
private readonly IText text;
private readonly IUserInterfaceFactory uiFactory;
private SessionConfiguration Session
{
@ -95,6 +95,13 @@ namespace SafeExamBrowser.Runtime
sessionSequence.ProgressChanged += SessionSequence_ProgressChanged;
sessionSequence.StatusChanged += SessionSequence_StatusChanged;
// We need to show the runtime window here already, this way implicitly setting it as the runtime application's main window.
// Otherwise, the splash screen is considered as the main window and thus the operating system and/or WPF does not correctly
// activate the runtime window once bootstrapping has finished, which in turn leads to undesired UI behavior.
runtimeWindow.Show();
runtimeWindow.BringToForeground();
runtimeWindow.SetIndeterminate();
splashScreen.Show();
splashScreen.BringToForeground();

View file

@ -31,7 +31,7 @@ namespace SafeExamBrowser.UserInterface.Contracts
void SetIndeterminate();
/// <summary>
/// Sets the maximum progress value.
/// Sets the maximum progress value. Resets the style of the progress indicator to determinate in case it has been set to indeterminate.
/// </summary>
void SetMaxValue(int max);

View file

@ -113,6 +113,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
public void SetMaxValue(int max)
{
model.IsIndeterminate = false;
model.MaxProgress = max;
}

View file

@ -21,7 +21,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
{
private readonly ProgressIndicatorViewModel model;
private readonly IText text;
private AppConfig appConfig;
private bool allowClose;
@ -106,6 +106,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
public void SetMaxValue(int max)
{
model.IsIndeterminate = false;
model.MaxProgress = max;
}

View file

@ -113,6 +113,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
public void SetMaxValue(int max)
{
model.IsIndeterminate = false;
model.MaxProgress = max;
}

View file

@ -106,6 +106,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
public void SetMaxValue(int max)
{
model.IsIndeterminate = false;
model.MaxProgress = max;
}