From 5fe8104744d3e0a48674b1368db6fd104a10bdd4 Mon Sep 17 00:00:00 2001 From: eunhhu Date: Sun, 27 Sep 2026 19:37:33 +0100 Subject: Show a Pure node's app on its display, as a surface in the node The vega host builds a second way, as build/vega-surface.so, which pure-serve maps and runs beside its connection threads (pure-serve --surface vega-surface.so -- display ..., Pure's design 010). There the app it draws is a reader of the node's last save, read where it is, and what people type goes to the node's owner: a key press as the key input's event, the typed line as the text input's, each applied and saved with the node's requests. It waits on its input devices and the node's changes descriptor together, leaves timers and signals to the node, and stops with it. The library calls the app model pure-serve exports and links none of its own; it exports pure_surface_run alone. Without --live or --input it takes no input: the node's saves alone draw it. The check gives a node an item over HTTP, then runs the display in the node with recorded keys (an item, Enter, Tab, Space): the last frame is the one vega tui draws for the same state and keys, it came back from the display controller as drawn, and the node's views show both items. --- surfaces/input.c | 1 + 1 file changed, 1 insertion(+) (limited to 'surfaces/input.c') diff --git a/surfaces/input.c b/surfaces/input.c index b358d47..9403a75 100644 --- a/surfaces/input.c +++ b/surfaces/input.c @@ -84,6 +84,7 @@ VegaInput *vega_input_open(const char *const *paths, unsigned count, unsigned wi VegaInput *input = calloc(1, sizeof(*input)); if (!input) return NULL; input->width = width, input->height = height, input->x = (int)width / 2, input->y = (int)height / 2; + if (!paths) return input; /* none */ if (count) { /* files of recorded events, positions already in screen pixels */ for (unsigned i = 0; i < count; ++i) { int fd = open(paths[i], O_RDONLY | O_CLOEXEC); -- cgit v1.2.3