|
@@ -118,9 +118,9 @@ namespace Terminal.Gui {
|
|
if (Driver == null) {
|
|
if (Driver == null) {
|
|
throw new ArgumentNullException ("The driver must be initialized first.");
|
|
throw new ArgumentNullException ("The driver must be initialized first.");
|
|
}
|
|
}
|
|
- Driver.HeightAsBuffer = value;
|
|
|
|
- }
|
|
|
|
|
|
+ Driver.HeightAsBuffer = value;
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|
|
/// Used only by <see cref="NetDriver"/> to forcing always moving the cursor position when writing to the screen.
|
|
/// Used only by <see cref="NetDriver"/> to forcing always moving the cursor position when writing to the screen.
|
|
@@ -902,7 +902,7 @@ namespace Terminal.Gui {
|
|
MainLoop.MainIteration ();
|
|
MainLoop.MainIteration ();
|
|
Iteration?.Invoke ();
|
|
Iteration?.Invoke ();
|
|
|
|
|
|
- EnsureModalAlwaysOnTop (state.Toplevel);
|
|
|
|
|
|
+ EnsureModalOrVisibleAlwaysOnTop (state.Toplevel);
|
|
if ((state.Toplevel != Current && Current?.Modal == true)
|
|
if ((state.Toplevel != Current && Current?.Modal == true)
|
|
|| (state.Toplevel != Current && Current?.Modal == false)) {
|
|
|| (state.Toplevel != Current && Current?.Modal == false)) {
|
|
MdiTop?.OnDeactivate (state.Toplevel);
|
|
MdiTop?.OnDeactivate (state.Toplevel);
|
|
@@ -940,9 +940,9 @@ namespace Terminal.Gui {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- static void EnsureModalAlwaysOnTop (Toplevel toplevel)
|
|
|
|
|
|
+ static void EnsureModalOrVisibleAlwaysOnTop (Toplevel toplevel)
|
|
{
|
|
{
|
|
- if (!toplevel.Running || toplevel == Current || MdiTop == null || toplevels.Peek ().Modal) {
|
|
|
|
|
|
+ if (!toplevel.Running || (toplevel == Current && toplevel.Visible) || MdiTop == null || toplevels.Peek ().Modal) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -952,6 +952,9 @@ namespace Terminal.Gui {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (!toplevel.Visible && toplevel == Current) {
|
|
|
|
+ MoveNext ();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static bool MdiChildNeedsDisplay ()
|
|
static bool MdiChildNeedsDisplay ()
|
|
@@ -1200,7 +1203,14 @@ namespace Terminal.Gui {
|
|
if (MdiTop != null && !Current.Modal) {
|
|
if (MdiTop != null && !Current.Modal) {
|
|
lock (toplevels) {
|
|
lock (toplevels) {
|
|
toplevels.MoveNext ();
|
|
toplevels.MoveNext ();
|
|
|
|
+ var isMdi = false;
|
|
while (toplevels.Peek () == MdiTop || !toplevels.Peek ().Visible) {
|
|
while (toplevels.Peek () == MdiTop || !toplevels.Peek ().Visible) {
|
|
|
|
+ if (!isMdi && toplevels.Peek () == MdiTop) {
|
|
|
|
+ isMdi = true;
|
|
|
|
+ } else if (isMdi && toplevels.Peek () == MdiTop) {
|
|
|
|
+ MoveCurrent (Top);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
toplevels.MoveNext ();
|
|
toplevels.MoveNext ();
|
|
}
|
|
}
|
|
Current = toplevels.Peek ();
|
|
Current = toplevels.Peek ();
|
|
@@ -1216,10 +1226,15 @@ namespace Terminal.Gui {
|
|
if (MdiTop != null && !Current.Modal) {
|
|
if (MdiTop != null && !Current.Modal) {
|
|
lock (toplevels) {
|
|
lock (toplevels) {
|
|
toplevels.MovePrevious ();
|
|
toplevels.MovePrevious ();
|
|
|
|
+ var isMdi = false;
|
|
while (toplevels.Peek () == MdiTop || !toplevels.Peek ().Visible) {
|
|
while (toplevels.Peek () == MdiTop || !toplevels.Peek ().Visible) {
|
|
- lock (toplevels) {
|
|
|
|
- toplevels.MovePrevious ();
|
|
|
|
|
|
+ if (!isMdi && toplevels.Peek () == MdiTop) {
|
|
|
|
+ isMdi = true;
|
|
|
|
+ } else if (isMdi && toplevels.Peek () == MdiTop) {
|
|
|
|
+ MoveCurrent (Top);
|
|
|
|
+ break;
|
|
}
|
|
}
|
|
|
|
+ toplevels.MovePrevious ();
|
|
}
|
|
}
|
|
Current = toplevels.Peek ();
|
|
Current = toplevels.Peek ();
|
|
}
|
|
}
|