事件循环框架

This commit is contained in:
2026-04-01 16:08:01 +08:00
parent 90a25fb120
commit 196dab9bb3
11 changed files with 119 additions and 9 deletions

View File

@@ -4,6 +4,7 @@
#include "base/memory.h"
#include "core/backend.h"
#include "core/event.h"
#include "core/state.h"
#include "core/wm_desc.h"
@@ -90,3 +91,12 @@ void runtime_shutdown(runtime_t *runtime) {
if (runtime->config_module_handle) dlclose(runtime->config_module_handle);
runtime->config_module_handle = nullptr;
}
void runtime_run(runtime_t *runtime) {
for (;;) {
event_t event = {0};
if (!backend_next_event(runtime->backend, &event)) {
break;
}
}
}