diff --git a/Dalamud/Game/Internal/DalamudAtkTweaks.cs b/Dalamud/Game/Internal/DalamudAtkTweaks.cs index 466401ef3..486af463c 100644 --- a/Dalamud/Game/Internal/DalamudAtkTweaks.cs +++ b/Dalamud/Game/Internal/DalamudAtkTweaks.cs @@ -113,7 +113,7 @@ internal sealed unsafe class DalamudAtkTweaks : IInternalDisposableService private void AtkUnitBaseReceiveGlobalEventDetour(AtkUnitBase* thisPtr, AtkEventType eventType, int eventParam, AtkEvent* atkEvent, AtkEventData* atkEventData) { // 3 == Close - if (eventType == AtkEventType.InputReceived && WindowSystem.ShouldInhibitAtkCloseEvents && atkEventData != null && *(int*)atkEventData == 3 && this.configuration.IsFocusManagementEnabled) + if (eventType == AtkEventType.InputReceived && WindowSystem.HasAnyWindowSystemFocus && atkEventData != null && *(int*)atkEventData == 3 && this.configuration.IsFocusManagementEnabled) { Log.Verbose($"Cancelling global event SendHotkey command due to WindowSystem {WindowSystem.FocusedWindowSystemNamespace}"); return; @@ -124,7 +124,7 @@ internal sealed unsafe class DalamudAtkTweaks : IInternalDisposableService private void AgentHudOpenSystemMenuDetour(AgentHUD* thisPtr, AtkValue* atkValueArgs, uint menuSize) { - if (WindowSystem.ShouldInhibitAtkCloseEvents && this.configuration.IsFocusManagementEnabled) + if (WindowSystem.HasAnyWindowSystemFocus && this.configuration.IsFocusManagementEnabled) { Log.Verbose($"Cancelling OpenSystemMenu due to WindowSystem {WindowSystem.FocusedWindowSystemNamespace}"); return; diff --git a/Dalamud/Interface/Internal/InterfaceManager.cs b/Dalamud/Interface/Internal/InterfaceManager.cs index 76a1b5172..d68bc8bef 100644 --- a/Dalamud/Interface/Internal/InterfaceManager.cs +++ b/Dalamud/Interface/Internal/InterfaceManager.cs @@ -1175,7 +1175,6 @@ internal partial class InterfaceManager : IInternalDisposableService WindowSystem.HasAnyWindowSystemFocus = false; WindowSystem.FocusedWindowSystemNamespace = string.Empty; - WindowSystem.ShouldInhibitAtkCloseEvents = false; if (this.IsDispatchingEvents) { diff --git a/Dalamud/Interface/Windowing/Window.cs b/Dalamud/Interface/Windowing/Window.cs index f12e87099..44ff62199 100644 --- a/Dalamud/Interface/Windowing/Window.cs +++ b/Dalamud/Interface/Windowing/Window.cs @@ -226,16 +226,6 @@ public abstract class Window /// public bool AllowClickthrough { get; set; } = true; - /// - /// Gets a value indicating whether this window is pinned. - /// - public bool IsPinned => this.internalIsPinned; - - /// - /// Gets a value indicating whether this window is click-through. - /// - public bool IsClickthrough => this.internalIsClickthrough; - /// /// Gets or sets a list of available title bar buttons. /// diff --git a/Dalamud/Interface/Windowing/WindowSystem.cs b/Dalamud/Interface/Windowing/WindowSystem.cs index d6e9649bb..87bd199a1 100644 --- a/Dalamud/Interface/Windowing/WindowSystem.cs +++ b/Dalamud/Interface/Windowing/WindowSystem.cs @@ -60,12 +60,6 @@ public class WindowSystem /// public string? Namespace { get; set; } - /// - /// Gets or sets a value indicating whether ATK close events should be inhibited while any window has focus. - /// Does not respect windows that are pinned or clickthrough. - /// - internal static bool ShouldInhibitAtkCloseEvents { get; set; } - /// /// Add a window to this . /// The window system doesn't own your window, it just renders it @@ -136,7 +130,7 @@ public class WindowSystem window.DrawInternal(flags, persistence); } - var focusedWindow = this.windows.FirstOrDefault(window => window.IsFocused); + var focusedWindow = this.windows.FirstOrDefault(window => window.IsFocused && window.RespectCloseHotkey); this.HasAnyFocus = focusedWindow != default; if (this.HasAnyFocus) @@ -161,11 +155,6 @@ public class WindowSystem } } - ShouldInhibitAtkCloseEvents |= this.windows.Any(w => w.IsFocused && - w.RespectCloseHotkey && - !w.IsPinned && - !w.IsClickthrough); - if (hasNamespace) ImGui.PopID(); }