diff --git a/src/kernel/ui/WindowContext.hx b/src/kernel/ui/WindowContext.hx index 2ed431c..1a60928 100644 --- a/src/kernel/ui/WindowContext.hx +++ b/src/kernel/ui/WindowContext.hx @@ -7,6 +7,9 @@ import kernel.ButtonType; import util.Vec.Vec2; import lib.TermWriteable; +/** + The main object you interact with when writing anything to the screen. +**/ class WindowContext implements TermWriteable { private final writer:VirtualTermWriter; @@ -26,7 +29,8 @@ class WindowContext implements TermWriteable { @:allow(kernel.ui.WindowManager) private final mouseUpTrigger:SignalTrigger<{button:ButtonType, pos:Vec2}>; @:allow(kernel.ui.WindowManager) private final pasteTrigger:SignalTrigger; - public function new(writer:VirtualTermWriter) { + @:allow(kernel.ui.WindowManager) + private function new(writer:VirtualTermWriter) { this.writer = writer; this.onResize = writer.onResize; diff --git a/src/kernel/ui/WindowManager.hx b/src/kernel/ui/WindowManager.hx index a58e72a..efb749b 100644 --- a/src/kernel/ui/WindowManager.hx +++ b/src/kernel/ui/WindowManager.hx @@ -67,10 +67,6 @@ class WindowManager { allContexts.push(newContext); - // newContext.setTarget(MainTerm.instance); - newContext.enable(); - currentMainContext = newContext; - return newContext; } @@ -84,6 +80,7 @@ class WindowManager { var target:TermWriteable; if (output == "main") { target = MainTerm.instance; + currentMainContext = context; } else { target = Peripheral.instance.getScreen(output); diff --git a/src/lib/TermIO.hx b/src/lib/TermIO.hx index 365999e..6cc457b 100644 --- a/src/lib/TermIO.hx +++ b/src/lib/TermIO.hx @@ -12,7 +12,7 @@ class TermIO { public function new(output:TermWriteable) { this.output = output; - output.clear(); + output.reset(); output.setCursorPos(0, 0); }