mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2026-01-01 16:59:35 +01:00
Fixed ContextMenu crash
This commit is contained in:
@@ -314,21 +314,14 @@ public static partial class Application // Keyboard handling
|
||||
static () =>
|
||||
{
|
||||
// TODO: This OverlapppedTop tomfoolery goes away in addressing #2491
|
||||
if (ApplicationOverlapped.OverlappedTop is null)
|
||||
if (ApplicationOverlapped.OverlappedTop is null && Current is { })
|
||||
{
|
||||
if (Current is { })
|
||||
{
|
||||
return Current.AdvanceFocus (NavigationDirection.Backward, TabBehavior.TabGroup);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ApplicationOverlapped.OverlappedMovePrevious ();
|
||||
|
||||
return true;
|
||||
return Current.AdvanceFocus (NavigationDirection.Backward, TabBehavior.TabGroup);
|
||||
}
|
||||
|
||||
return false;
|
||||
ApplicationOverlapped.OverlappedMovePrevious ();
|
||||
|
||||
return true;
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -105,6 +105,10 @@ public sealed class ContextMenu : IDisposable
|
||||
/// <summary>Disposes the context menu object.</summary>
|
||||
public void Dispose ()
|
||||
{
|
||||
if (_menuBar is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_menuBar.MenuAllClosed -= MenuBar_MenuAllClosed;
|
||||
Application.UngrabMouse ();
|
||||
_menuBar?.Dispose ();
|
||||
|
||||
Reference in New Issue
Block a user