Right-clicking a name or an item inside a pop-out did nothing at all. One payload handler is shared by the main window, every pop-out and the input preview, and it holds a single popup state. The main window is registered first, so it draws first, finds no open popup in its own scope, reads that as "closed" and clears the state -- before the window that actually opened the popup gets its turn. The popup now belongs to the surface that opened it. The others leave its state alone instead of dropping it. The rule itself sits in its own helper because the handler pulls in Dalamud and cannot be loaded from a test.
13 lines
535 B
C#
13 lines
535 B
C#
namespace HellionChat.Util;
|
|
|
|
// Chat surfaces share one payload handler and all render it in the same frame.
|
|
// A popup belongs to the surface that opened it; the others must leave its
|
|
// state alone instead of reading "no popup here" as "popup was closed".
|
|
internal static class PopupOwnership
|
|
{
|
|
// Reference identity on purpose -- two surfaces can compare equal without
|
|
// being the same window.
|
|
internal static bool Owns(object? owner, object? surface) =>
|
|
owner is not null && ReferenceEquals(owner, surface);
|
|
}
|