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); }