fix: clean up pop-out window when auto-tell tab is LRU-dropped
This commit is contained in:
@@ -183,6 +183,22 @@ internal sealed class AutoTellTabsService : IDisposable
|
|||||||
return;
|
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);
|
Plugin.Config.Tabs.RemoveAt(victim.Index);
|
||||||
|
|
||||||
// Re-anchor the active tab so the user does not silently end up on
|
// Re-anchor the active tab so the user does not silently end up on
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ internal class Popout : Window
|
|||||||
public ChatInputBar? InputBar { get; private set; }
|
public ChatInputBar? InputBar { get; private set; }
|
||||||
public bool HasFocusedInputBar => InputBar?.IsFocused ?? false;
|
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")
|
public Popout(ChatLogWindow chatLogWindow, Tab tab, int idx) : base($"{tab.Name}##popout")
|
||||||
{
|
{
|
||||||
ChatLogWindow = chatLogWindow;
|
ChatLogWindow = chatLogWindow;
|
||||||
|
|||||||
Reference in New Issue
Block a user