Skip to content

Commit 4241cb3

Browse files
committed
WIP: More GetViewsUnderMouse work
1 parent 6fff834 commit 4241cb3

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Terminal.Gui/View/View.Mouse.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ internal bool SetPressedHighlight (HighlightStyle newHighlightStyle)
773773
if (Application.PopoverHost?.Visible == true)
774774
{
775775
start = Application.PopoverHost;
776+
777+
viewsUnderMouse.Add (Application.Top);
776778
}
777779

778780
Point currentLocation = location;
@@ -830,13 +832,14 @@ internal bool SetPressedHighlight (HighlightStyle newHighlightStyle)
830832

831833
if (subview is null)
832834
{
833-
if (start.ViewportSettings.HasFlag (ViewportSettings.TransparentMouse))
835+
// In the case start is transparent, recursively add all it's subviews etc...
836+
if (start.ViewportSettings.HasFlag (ViewportSettings.TransparentMouse) && !viewsUnderMouse.Contains(start))
834837
{
835838
viewsUnderMouse.AddRange (View.GetViewsUnderMouse (location, true));
836839

837840
// De-dupe viewsUnderMouse
838-
HashSet<View?> dedupe = [.. viewsUnderMouse];
839-
viewsUnderMouse = [.. dedupe];
841+
HashSet<View?> hashSet = [.. viewsUnderMouse];
842+
viewsUnderMouse = [.. hashSet];
840843
}
841844

842845
// No subview was found that's under the mouse, so we're done

0 commit comments

Comments
 (0)