From 22e4e3fa7bf4b28542d21cd6308055cc90c56e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Fri, 2 Sep 2022 15:00:51 +0200 Subject: [PATCH] SEBWIN-477: Ensured multiple lock screen instructions sent by the server don't cause multiple lock screens. --- SafeExamBrowser.Client/ClientController.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/SafeExamBrowser.Client/ClientController.cs b/SafeExamBrowser.Client/ClientController.cs index c60d182a..53c04883 100644 --- a/SafeExamBrowser.Client/ClientController.cs +++ b/SafeExamBrowser.Client/ClientController.cs @@ -654,9 +654,18 @@ namespace SafeExamBrowser.Client private void Server_LockScreenRequested(string message) { - logger.Info("Received lock screen event from SEB Server."); - var title = text.Get(TextKey.LockScreen_Title); - ShowLockScreen(message, title, Enumerable.Empty()); + logger.Info("Attempting to show lock screen as requested by the server..."); + + if (!sessionLocked) + { + sessionLocked = true; + ShowLockScreen(message, text.Get(TextKey.LockScreen_Title), Enumerable.Empty()); + sessionLocked = false; + } + else + { + logger.Info("Lock screen is already active."); + } } private void Server_TerminationRequested()