feat(main-window): track per-frame window pos/size/viewport for PayloadHandler
Replaces the v1.5.6 `LogWindow.LastViewport/LastWindowPos/LastWindowSize` window-instance state with public/internal MainWindow surfaces refreshed at the top of Draw() each frame. PayloadHandler.MoveTooltip in Phase 2 will read these to filter cross-viewport AddonLifecycle events and to reposition the native item tooltip away from the chat window. LastViewport is `internal unsafe` (not public) — the only consumer is PayloadHandler.MoveTooltip in the same assembly; keeping the raw pointer out of the public surface is the safer default. Split from Sub-Task A — Lender injection lives in A2 (after F's DI-reg).
This commit is contained in:
@@ -29,6 +29,10 @@ internal sealed class MainWindow : Window
|
|||||||
|
|
||||||
private Tab? _activeTab;
|
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(
|
public MainWindow(
|
||||||
Components.HonorificHeader honorific,
|
Components.HonorificHeader honorific,
|
||||||
Components.Sidebar sidebar,
|
Components.Sidebar sidebar,
|
||||||
@@ -81,6 +85,13 @@ internal sealed class MainWindow : Window
|
|||||||
|
|
||||||
public override void Draw()
|
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
|
// First-frame seed: the active tab defaults to the first persisted
|
||||||
// tab so the message list isn't empty on a clean session.
|
// tab so the message list isn't empty on a clean session.
|
||||||
if (_activeTab is null && Plugin.Config.Tabs.Count > 0)
|
if (_activeTab is null && Plugin.Config.Tabs.Count > 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user