From a1d050d3074001f784989e708fd005f88aa4aae9 Mon Sep 17 00:00:00 2001 From: Regalis Date: Mon, 12 Dec 2016 13:29:41 +0200 Subject: [PATCH] Keyboard focus is automatically removed from a GUIComponent if it's not in the GUIUpdateList --- Subsurface/Source/GUI/GUIComponent.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Subsurface/Source/GUI/GUIComponent.cs b/Subsurface/Source/GUI/GUIComponent.cs index dc8e9d7cc..73a4142c7 100644 --- a/Subsurface/Source/GUI/GUIComponent.cs +++ b/Subsurface/Source/GUI/GUIComponent.cs @@ -33,6 +33,12 @@ namespace Barotrauma public static void ClearUpdateList() { + if (KeyboardDispatcher.Subscriber is GUIComponent && + !ComponentsToUpdate.Contains((GUIComponent)KeyboardDispatcher.Subscriber)) + { + KeyboardDispatcher.Subscriber = null; + } + ComponentsToUpdate.Clear(); }