diff --git a/HellionChat/Ui/Windows/MainWindow.cs b/HellionChat/Ui/Windows/MainWindow.cs index e38c87f..c1293ca 100644 --- a/HellionChat/Ui/Windows/MainWindow.cs +++ b/HellionChat/Ui/Windows/MainWindow.cs @@ -29,6 +29,10 @@ internal sealed class MainWindow : Window private Tab? _activeTab; + public Vector2 LastWindowPos { get; private set; } = Vector2.Zero; + public Vector2 LastWindowSize { get; private set; } = Vector2.Zero; + internal unsafe ImGuiViewport* LastViewport; + public MainWindow( Components.HonorificHeader honorific, Components.Sidebar sidebar, @@ -81,6 +85,13 @@ internal sealed class MainWindow : Window public override void Draw() { + LastWindowPos = ImGui.GetWindowPos(); + LastWindowSize = ImGui.GetWindowSize(); + unsafe + { + LastViewport = ImGui.GetWindowViewport().Handle; + } + // First-frame seed: the active tab defaults to the first persisted // tab so the message list isn't empty on a clean session. if (_activeTab is null && Plugin.Config.Tabs.Count > 0)