Fixes #1467. AlternateForward/BackwardKey bypasses dialog modality (#1468)

This commit is contained in:
BDisp
2021-09-29 22:22:53 +01:00
committed by GitHub
parent 23d4fa9016
commit c7d1e15cad

View File

@@ -342,11 +342,12 @@ namespace Terminal.Gui {
case Key.Tab | Key.CtrlMask:
case Key key when key == Application.AlternateForwardKey: // Needed on Unix
if (Application.MdiTop == null) {
Application.Top.FocusNext ();
if (Application.Top.Focused == null) {
Application.Top.FocusNext ();
var top = Modal ? this : Application.Top;
top.FocusNext ();
if (top.Focused == null) {
top.FocusNext ();
}
Application.Top.SetNeedsDisplay ();
top.SetNeedsDisplay ();
} else {
MoveNext ();
}
@@ -354,11 +355,12 @@ namespace Terminal.Gui {
case Key.Tab | Key.ShiftMask | Key.CtrlMask:
case Key key when key == Application.AlternateBackwardKey: // Needed on Unix
if (Application.MdiTop == null) {
Application.Top.FocusPrev ();
if (Application.Top.Focused == null) {
Application.Top.FocusPrev ();
var top = Modal ? this : Application.Top;
top.FocusPrev ();
if (top.Focused == null) {
top.FocusPrev ();
}
Application.Top.SetNeedsDisplay ();
top.SetNeedsDisplay ();
} else {
MovePrevious ();
}