diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index 2efa38ff3..ec9115d8d 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -43,6 +43,11 @@ namespace Dalamud.Interface.Windowing /// public string WindowName { get; set; } + /// + /// Gets a value indicating whether the window is focused. + /// + public bool IsFocused { get; private set; } + /// /// Gets or sets the position of this window. /// @@ -188,8 +193,10 @@ namespace Dalamud.Interface.Windowing // Draw the actual window contents this.Draw(); + this.IsFocused = ImGui.IsWindowFocused(); + var escapeDown = Service.Get()[VirtualKey.ESCAPE]; - if (escapeDown && ImGui.IsWindowFocused() && !wasEscPressedLastFrame) + if (escapeDown && this.IsFocused && !wasEscPressedLastFrame) { this.IsOpen = false; wasEscPressedLastFrame = true;