|
@@ -787,6 +787,7 @@ namespace Terminal {
|
|
public class Application {
|
|
public class Application {
|
|
public static ConsoleDriver Driver = new CursesDriver ();
|
|
public static ConsoleDriver Driver = new CursesDriver ();
|
|
public static Toplevel Top { get; private set; }
|
|
public static Toplevel Top { get; private set; }
|
|
|
|
+ public static View Current { get; private set; }
|
|
public static Mono.Terminal.MainLoop MainLoop { get; private set; }
|
|
public static Mono.Terminal.MainLoop MainLoop { get; private set; }
|
|
|
|
|
|
static Stack<View> toplevels = new Stack<View> ();
|
|
static Stack<View> toplevels = new Stack<View> ();
|
|
@@ -852,6 +853,7 @@ namespace Terminal {
|
|
MainLoop = new Mono.Terminal.MainLoop ();
|
|
MainLoop = new Mono.Terminal.MainLoop ();
|
|
SynchronizationContext.SetSynchronizationContext (new MainLoopSyncContext (MainLoop));
|
|
SynchronizationContext.SetSynchronizationContext (new MainLoopSyncContext (MainLoop));
|
|
Top = Toplevel.Create ();
|
|
Top = Toplevel.Create ();
|
|
|
|
+ Current = Top;
|
|
focus = Top;
|
|
focus = Top;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -879,14 +881,14 @@ namespace Terminal {
|
|
|
|
|
|
static void ProcessKeyEvent (KeyEvent ke)
|
|
static void ProcessKeyEvent (KeyEvent ke)
|
|
{
|
|
{
|
|
- if (Top.ProcessHotKey (ke))
|
|
|
|
|
|
+ if (Current.ProcessHotKey (ke))
|
|
return;
|
|
return;
|
|
|
|
|
|
- if (Top.ProcessKey (ke))
|
|
|
|
|
|
+ if (Current.ProcessKey (ke))
|
|
return;
|
|
return;
|
|
|
|
|
|
// Process the key normally
|
|
// Process the key normally
|
|
- if (Top.ProcessColdKey (ke))
|
|
|
|
|
|
+ if (Current.ProcessColdKey (ke))
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -899,6 +901,7 @@ namespace Terminal {
|
|
|
|
|
|
Init ();
|
|
Init ();
|
|
toplevels.Push (toplevel);
|
|
toplevels.Push (toplevel);
|
|
|
|
+ Current = toplevel;
|
|
Driver.PrepareToRun (MainLoop, ProcessKeyEvent);
|
|
Driver.PrepareToRun (MainLoop, ProcessKeyEvent);
|
|
toplevel.LayoutSubviews ();
|
|
toplevel.LayoutSubviews ();
|
|
toplevel.FocusFirst ();
|
|
toplevel.FocusFirst ();
|
|
@@ -953,8 +956,10 @@ namespace Terminal {
|
|
toplevels.Pop ();
|
|
toplevels.Pop ();
|
|
if (toplevels.Count == 0)
|
|
if (toplevels.Count == 0)
|
|
Shutdown ();
|
|
Shutdown ();
|
|
- else
|
|
|
|
|
|
+ else {
|
|
|
|
+ Current = toplevels.Peek ();
|
|
Refresh ();
|
|
Refresh ();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|