introduce active and passive events

This commit is contained in:
2025-04-23 13:51:09 -05:00
parent a3fb96abb7
commit b4ac013f18
17 changed files with 197 additions and 42 deletions

View File

@@ -17,7 +17,11 @@ Terminal::Terminal(Archimedes::App* a, void* h) : Archimedes::Module(a, h) {
}
Terminal::~Terminal() {
if(app) {}
if(app) {
ImguiModule* im; { im = (ImguiModule*) moduleInstances[ImguiModule()]; }
im->releaseContext(ImGui::GetCurrentContext());
}
}
void Terminal::onLoad() {
@@ -29,7 +33,7 @@ void Terminal::onLoad() {
std::abort();
}
ImGui::SetCurrentContext(im->getContext());
ImGui::SetCurrentContext(im->aquireContext());
child_pid = forkpty(&master, nullptr, nullptr, nullptr);
@@ -67,7 +71,7 @@ void Terminal::run() {
rc = read(master, opArr, 150);
if(rc < 0) {
//error on read
app->stopModule(name);
app->emitEvent(new Archimedes::DoUnloadModuleEvent(name));
} else {
if(input == "clear") output = "";
output += opArr;