diff --git a/AutoShutdown/Plogon.cs b/AutoShutdown/Plogon.cs index 76162f9..23189a6 100644 --- a/AutoShutdown/Plogon.cs +++ b/AutoShutdown/Plogon.cs @@ -5,6 +5,7 @@ using AutoRetainerAPI; using Dalamud.Plugin; using Dalamud.Plugin.Services; using ECommons; +using FFXIVClientStructs.FFXIV.Client.System.Framework; using LLib; namespace AutoShutdown; @@ -58,7 +59,11 @@ public sealed class Plogon : IDalamudPlugin } // move to background using alt+esc - SendKeys.SendWait("%({esc})"); + unsafe + { + if (!Framework.Instance()->WindowInactive) + SendKeys.SendWait("%({esc})"); + } } public void Dispose()