Skip to content

Commit 2fec02d

Browse files
author
tznind
committed
Switch to visible event for detecting when menu closes
gui-cs/Terminal.Gui#4997
1 parent 621520e commit 2fec02d

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/UI/Editor.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1060,6 +1060,16 @@ private void CreateAndShowContextMenu(Mouse? m, Design? rightClicked)
10601060
SelectionManager.Instance.LockSelection = false;
10611061
app.Popovers.DeRegister(menu);
10621062
};
1063+
menu.VisibleChanged += (_, e) =>
1064+
{
1065+
// Its closing probably
1066+
if(menu.Visible == false)
1067+
{
1068+
this.menuOpen = false;
1069+
SelectionManager.Instance.LockSelection = false;
1070+
app.Popovers.DeRegister(menu);
1071+
}
1072+
};
10631073
}
10641074

10651075
private static MenuItem ToMenuItem(IApplication application, IOperation operation)

0 commit comments

Comments
 (0)