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 public class App : Application
{ {
private static readonly Mutex Mutex = new Mutex(true, AppConfig.RUNTIME_MUTEX_NAME); private static readonly Mutex Mutex = new Mutex(true, AppConfig.RUNTIME_MUTEX_NAME);
private CompositionRoot instances = new CompositionRoot(); private readonly CompositionRoot instances = new CompositionRoot();
[STAThread] [STAThread]
public static void Main() public static void Main()

View file

@ -31,19 +31,19 @@ namespace SafeExamBrowser.Runtime
{ {
internal class RuntimeController internal class RuntimeController
{ {
private AppConfig appConfig; private readonly AppConfig appConfig;
private ILogger logger; private readonly ILogger logger;
private IMessageBox messageBox; private readonly IMessageBox messageBox;
private IOperationSequence bootstrapSequence; private readonly IOperationSequence bootstrapSequence;
private IRepeatableOperationSequence sessionSequence; private readonly IRepeatableOperationSequence sessionSequence;
private IRuntimeHost runtimeHost; private readonly IRuntimeHost runtimeHost;
private IRuntimeWindow runtimeWindow; private readonly IRuntimeWindow runtimeWindow;
private IServiceProxy service; private readonly IServiceProxy service;
private SessionContext sessionContext; private readonly SessionContext sessionContext;
private ISplashScreen splashScreen; private readonly ISplashScreen splashScreen;
private Action shutdown; private readonly Action shutdown;
private IText text; private readonly IText text;
private IUserInterfaceFactory uiFactory; private readonly IUserInterfaceFactory uiFactory;
private SessionConfiguration Session private SessionConfiguration Session
{ {
@ -95,6 +95,13 @@ namespace SafeExamBrowser.Runtime
sessionSequence.ProgressChanged += SessionSequence_ProgressChanged; sessionSequence.ProgressChanged += SessionSequence_ProgressChanged;
sessionSequence.StatusChanged += SessionSequence_StatusChanged; 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.Show();
splashScreen.BringToForeground(); splashScreen.BringToForeground();

View file

@ -31,7 +31,7 @@ namespace SafeExamBrowser.UserInterface.Contracts
void SetIndeterminate(); void SetIndeterminate();
/// <summary> /// <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> /// </summary>
void SetMaxValue(int max); void SetMaxValue(int max);

View file

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

View file

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

View file

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

View file

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