diff --git a/ChatTwo/AutoTellTabsService.cs b/ChatTwo/AutoTellTabsService.cs index 100f7b0..c713fae 100644 --- a/ChatTwo/AutoTellTabsService.cs +++ b/ChatTwo/AutoTellTabsService.cs @@ -183,6 +183,22 @@ internal sealed class AutoTellTabsService : IDisposable return; } + // v0.6.1 — if the victim is currently popped out, tear down the + // matching Popout window first. Otherwise the window stays in + // PopOutWindows + WindowSystem and renders empty / re-spawns on the + // next AddPopOutsToDraw tick. Latent since pop-outs were introduced; + // becomes visible with AutoTellTabsOpenAsPopout where dropping a + // popped tab is now a routine code path. + if (victim.Tab.PopOut) + { + var popout = _plugin.ChatLogWindow.ActivePopouts + .FirstOrDefault(p => p.TabIdentifier == victim.Tab.Identifier); + if (popout != null) + { + popout.IsOpen = false; + } + } + Plugin.Config.Tabs.RemoveAt(victim.Index); // Re-anchor the active tab so the user does not silently end up on diff --git a/ChatTwo/Ui/Popout.cs b/ChatTwo/Ui/Popout.cs index 80899cb..3d8de1b 100644 --- a/ChatTwo/Ui/Popout.cs +++ b/ChatTwo/Ui/Popout.cs @@ -22,6 +22,11 @@ internal class Popout : Window public ChatInputBar? InputBar { get; private set; } public bool HasFocusedInputBar => InputBar?.IsFocused ?? false; + // Hellion Chat — v0.6.1 expose just the tab identifier (not the whole Tab + // reference) so AutoTellTabsService.DropOldestTempTab can locate the + // matching pop-out window when an LRU temp tab gets evicted. + internal Guid TabIdentifier => Tab.Identifier; + public Popout(ChatLogWindow chatLogWindow, Tab tab, int idx) : base($"{tab.Name}##popout") { ChatLogWindow = chatLogWindow;