Skip to content

Tags: romgrk/node-gtk

Tags

v4.1.1

Toggle v4.1.1's commit message
4.1.1

v4.1.0

Toggle v4.1.0's commit message
4.1.0

v4.0.1

Toggle v4.0.1's commit message
fix: stop GApplication busy-spin at 100% CPU under ESM (#477)

Under ES modules the blocking main-loop entry (Gio.Application.run,
GLib.MainLoop.run, Gtk.main) is deferred to a macrotask so pending
Promise/async continuations keep draining (#442). That deferral used
setImmediate, whose callback runs inside Node's immediate-processing
machinery (native CheckImmediate -> processImmediate).

Because run() never returns -- it blocks in the GLib main loop until the
app quits -- CheckImmediate never reaches the code that stops Node's
private immediate uv_idle handle, so that handle stays active forever. An
active idle handle pins uv_backend_timeout() at 0, which makes the nested
uv-in-GLib loop busy-spin at 100% CPU and starves the application (worst
on Node 26 / libuv 1.52, where the immediate's wakeup eventfd also stays
signalled).

Defer with setTimeout(..., 0) instead: a one-shot timer is removed from
libuv's timer heap before its callback runs, so blocking inside it leaves
no libuv state active and the loop can sleep normally. Still a macrotask,
so the #442 microtask-draining fix is preserved.

Adds a regression test (tests/loop__esm_idle_cpu) that runs an idle
GApplication under ESM and asserts it does not busy-spin.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

v4.0.0

Toggle v4.0.0's commit message
v4.0.0

Release the combined Node 26 support (drop Node 20) and fundamental-type
wrapping work as v4.0.0. Bump the version, refresh the changelog and the
README's supported-versions line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

v2.2.0

Toggle v2.2.0's commit message
chore: release v2.2.0

v1.0.0

Toggle v1.0.0's commit message
1.0.0

v0.14.0

Toggle v0.14.0's commit message
0.14.0