fix: don't consider child windows when checking Window focus

This commit is contained in:
goat 2021-09-01 20:44:45 +02:00
parent 3e9c1f8d53
commit 8401488ec5
No known key found for this signature in database
GPG key ID: F18F057873895461

View file

@ -2,6 +2,7 @@ using System.Numerics;
using Dalamud.Game.ClientState.Keys; using Dalamud.Game.ClientState.Keys;
using ImGuiNET; using ImGuiNET;
using Serilog;
namespace Dalamud.Interface.Windowing namespace Dalamud.Interface.Windowing
{ {
@ -201,7 +202,7 @@ namespace Dalamud.Interface.Windowing
// Draw the actual window contents // Draw the actual window contents
this.Draw(); this.Draw();
this.IsFocused = ImGui.IsWindowFocused(); this.IsFocused = ImGui.IsWindowFocused(ImGuiFocusedFlags.RootAndChildWindows);
var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE]; var escapeDown = Service<KeyState>.Get()[VirtualKey.ESCAPE];
if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey) if (escapeDown && this.IsFocused && !wasEscPressedLastFrame && this.RespectCloseHotkey)