Skip to content

feat(nx-rt-core): run the applet message pump from Rust - #169

Merged
LNSD merged 1 commit into
mainfrom
lnsd/applet-main-loop
Aug 17, 2026
Merged

LNSD merged 1 commit into
mainfrom
lnsd/applet-main-loop

Conversation

@LNSD

@LNSD LNSD commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

The pump was the last part of the applet surface still running as C against globals a Rust bring-up leaves zeroed, so a program asked to close was never told and the cached state it reads never moved.

  • main_loop takes one pass — the poll and the acting-on already here — and reports whether the program lives on, which is what ends a while (appletMainLoop())
  • All three pump symbols are aliased together (appletMainLoop, appletGetMessage, appletProcessMessage) so no part of a pass runs against the zeroed globals: the C appletProcessMessage calls diagAbortWithResult when the refresh it does with them fails, so a pass reaching it would take the process down
  • Overriding appletProcessMessage replaces the applet hook dispatch with nothing: a program that registered an appletHook still gets a successful registration and a callback that never runs
  • The result code for an empty queue is named once and shared by the two entry points that can report it, rather than spelled out at each

The pump was the last part of the applet surface still running as C against globals a Rust bring-up leaves zeroed, so a program asked to close was never told and the cached state it reads never moved.

- `main_loop` takes one pass — the poll and the acting-on already here — and reports whether the program lives on, which is what ends a `while (appletMainLoop())`
- All three pump symbols are aliased together (`appletMainLoop`, `appletGetMessage`, `appletProcessMessage`) so no part of a pass runs against the zeroed globals: the C `appletProcessMessage` calls `diagAbortWithResult` when the refresh it does with them fails, so a pass reaching it would take the process down
- Overriding `appletProcessMessage` replaces the applet hook dispatch with nothing: a program that registered an `appletHook` still gets a successful registration and a callback that never runs
- The result code for an empty queue is named once and shared by the two entry points that can report it, rather than spelled out at each

Signed-off-by: Lorenzo Delgado <lnsdev@proton.me>
@LNSD
LNSD added this pull request to the merge queue Aug 17, 2026
Merged via the queue into main with commit 2dcd32d Aug 17, 2026
4 checks passed
@LNSD
LNSD deleted the lnsd/applet-main-loop branch August 17, 2026 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant