98 Commits
Author SHA1 Message Date
Roman ChojnackiandClaude Opus 5.5 66e2d9a0ae Render: mask only frames that draw, one switch per command, SDL rects
The damage keys and the skip hash read the list before rounded fills
become masks; reaktor_damage_render masks once, after a frame proves to
draw and before any pass, the check pass included. command_read keys and
spans a command in one switch. Damage boxes are SDL_Rect, cut, joined and
tested through SDL's helpers; touches keeps its inclusive edge, and
nk_sdl_meets stays, as SDL_HasRectIntersectionFloat counts a shared edge.

The steppers of a property wash only where its field lights: one flag,
reaktor_property_live, for both. The manual says a new theme, icon or atlas
is redrawn where it changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 18:16:36 +01:00
Roman ChojnackiandClaude Opus 5.5 69758d2733 Tray: a setter sends, menu callbacks run between frames
reaktor_tray_check only sends ItemsPropertiesUpdated and reaktor_tray_open
only dispatches, so neither runs a queued .chosen callback in the middle of
a page build. Callbacks still run after dispatch, from reaktor_tray_event.
Closing the tray drops what was queued.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 18:16:35 +01:00
admin 192584eb9a Merge pull request #133 from Alpaq92/simplify-platform
Platform and UI: shared helpers, one hover test, fewer error objects
2026-11-09 17:45:51 +01:00
Roman ChojnackiandClaude Opus 5.5 bbdfeaeacb Damage: key textures by a serial number, not only their address
Each texture the image cache, the corner masks and the font atlas create
gets a serial number in its properties, and image and text keys carry it
next to the pointer, so a texture made again at a freed address reads as
changed. The window's clear color joins the frame hash. Evicting or
clearing the image cache, rebuilding the font and restyling no longer set
must_draw; window events still do.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:56:45 +01:00
Roman ChojnackiandClaude Opus 5.5 20c940e87f Render: one pass through one list
Rounded fills become masks once, right after the frame is built, so the
damage keys, text preparation and every pass see the same list.
reaktor_render(app, rects, n) is the one entry: n == 0 draws the whole
window, otherwise one SDL_RenderFillRects clears the rectangles before the
pass. nk_sdl_render_ex goes, and nk_sdl_frame_done keeps only nk_clear and
the frame time.

A frame whose commands changed but whose pixels would not is handled as a
skipped one: no render, no copy, no present.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:50:12 +01:00
Roman ChojnackiandClaude Opus 5.5 c8df8227db Tray: menu callbacks after dispatch, icons through SDL_ConvertPixels
A chosen item is recorded while gibus dispatches and its callback runs
once dispatch returns, so a callback that closes the tray or checks an
item no longer reenters the bus and the bookkeeping for that is gone.
Labels share reaktor_utf8_clean_dup, and errors nobody reads are NULL.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 16:48:42 +01:00
Roman ChojnackiandClaude Opus 5.5 b5bbe962ed Skip unchanged frames by default
A frame whose draw commands equal the last presented one is skipped, and on
the software renderer a changed frame is redrawn only where it changed, for
every app. The launch field .skip_same_frames becomes .draw_every_frame,
which turns both off; bench sets it so it keeps measuring full frames.

The launch struct an app sees changed, so libreaktor's SOVERSION is now 1,
and the runtime package libreaktor0 becomes libreaktor1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 14:23:07 +01:00
Roman ChojnackiandClaude Opus 5.5 b614363b6d Software: redraw only where the commands changed
With .skip_same_frames, a software frame at a whole-number scale now
redraws only the rectangles whose Nuklear commands changed. Each command
gets a key and a device-pixel box; the list is diffed against the last
drawn one and the changed boxes merged into at most four rectangles. The
frame is drawn into a target texture that keeps the last frame, as SDL
documents a window's back buffer does not, and copied to the window.
Anything that invalidates the window, a capture, a fractional scale or a
GPU renderer draws in full as before.

The test harness redraws every partial frame whole and compares pixels;
damagetest drives hovers, typing, popups, scrolling, toasts, focus,
tweens, a theme switch and scales 1, 2 and 1.25, with and without text
shaping. Shots and dumps match master on every tab in both themes.

Ryzen 5 4600H, showcase at 1100x680, 12 interleaved pairs: render -58% to
-61% per drawn frame, whole frames -42% to -46%, process CPU -9% (hover)
to -26% (slider drag).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 13:41:33 +01:00
admin cb4fb444f4 Merge pull request #118 from Alpaq92/gibus
D-Bus: take gibus as a submodule in place of platform/dbus
2026-11-09 11:52:01 +01:00
Roman ChojnackiandClaude Opus 5.5 c07d6100c2 Build: look icons up by name and ASCII glyphs by index
An icon drawn in a built frame no longer formats an
"external/ionicons/...svg?stroke=...&sw=..." string to find its texture:
the image cache keys Ionicons on name, stroke color, width and size, and
builds the path only on a miss. Codepoints below 128 find their glyph
through a table filled at bake time instead of a binary search.

Pixels and accessibility dumps are unchanged on every showcase tab in both
themes. Software renderer, every frame built, 16 interleaved pairs on a
Ryzen 5 4600H: build time -16% to -22% for icons and -10% to -17% for
glyphs on Login and Buttons; whole frames on Buttons -4.5% and -2.3%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:40:31 +01:00
Roman ChojnackiandClaude Opus 5.5 56f853fd0e D-Bus: take gibus as a submodule in place of platform/dbus
The client moves to its own library, gibus (MIT, ported from minidbus),
under external/gibus. It drops SDL for pthreads, so the runtime links
threads where it builds gibus. Callers, the private export list, the test
and CI follow the rename.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:25:12 +01:00
Roman ChojnackiandClaude Opus 5.5 b772d346df Comments: keep only what the code cannot say
A full audit of Reaktor's own sources: section banners, return-value and
parameter notes, and descriptions of what a function does are gone. What
stays records a library, OS or browser quirk, a threading or lifetime rule,
or a license. Two comments that still named libdbus are corrected. Code is
unchanged; the vendored nk_sdl3_renderer.h keeps its own comments.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 10:24:23 +01:00
Roman ChojnackiandClaude Opus 5.5 7c8fdb6732 D-Bus without libdbus: platform/dbus, a client of Reaktor's own
Linux and the BSDs spoke D-Bus through libdbus for the AT-SPI bridge,
the tray and notifications, and the theme code loaded it by hand for
the portal's appearance settings. platform/dbus is a client ported to
C from minidbus (MIT; licenses/minidbus.txt): EXTERNAL authentication
over a Unix socket, the message format validated as the specification
asks, and calls, replies, signals, match rules, exported paths and
fallbacks, Peer and default introspection, as libdbus answered them.
It is built into the runtime, and the modules reach it through the
map's private section; nothing links libdbus, and SDL alone still opens
it where the system has it.

dbustest checks the message format everywhere, with hostile input and a
mutation loop, and on Linux and the BSDs runs a private dbus-daemon for
the connection; CI asks for that half with --require-bus.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:11:59 +01:00
Roman ChojnackiandClaude Opus 5.5 25e22230ca Skip pacing leaves print passes alone and waits for every window's drag
A print page's build-only frames set the callback rate and never ran
the countdown that puts it back, so an idle app kept iterating at the
display's refresh. And a skipped tween frame in one window restored the
rate while another window still held a button. Build-only frames no
longer pace, and the rate comes back only when no window drags or
flings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 13:38:43 +01:00
Roman ChojnackiandClaude Opus 5.5 6066f21306 Timing that names the rasterizing, and skipped frames that stay clean and paced
SDL only queues draw calls, so a software frame's rasterizing was booked
as present. The runtime now flushes before the present timer, and the
docs and Diagnostics say what each number holds.

A skipped frame never reached nk_clear, so the next build's popups and
overlay never joined the list and combos stopped answering; it clears
now. Skipped frames also had no present to wait on, so a tween that
changed no pixel spun a core at about 390,000 frames a second. They now
follow the display's refresh, as a held mouse button does.

A software frame that opens by filling the whole window drops the clear
under it. A theme change forces the next frame to draw.

tests/skiptest.c covers both skip faults and runs in CI.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 03:21:55 +01:00
Roman ChojnackiandClaude Fable 5.1 c763039a16 No drop target for an app that opens no dropped file
SDL registers every window it creates as a drop target while a drop
event is enabled; on Windows that is COM's drag-and-drop, with clbcatq,
DataExchange and twinapi.appcore and three threads for the life of the
process. A launch with no .file_opened never reads SDL_EVENT_DROP_FILE,
so it disables the two drop events after SDL_Init, before any window.

Measured on bench (Ryzen 5 4600H, Windows 11 26300, software renderer):
window creation 26.7 to 21.9 ms, threads 5 to 2, modules 49 to 45,
0.2 to 0.5 MB less private; frame time unchanged. Pixels and
--a11y-dump identical across the showcase's tabs in both themes,
simple and notepad.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-11-04 13:33:28 +01:00
adminandClaude Opus 5.5 0c88ad0b67 Review: rerun a crash under its wrapper, and drop what nothing needs
check-libreaktor.sh reran a crash in gdb or lldb without the -w
wrapper, so a hang lost its timeout. The quit-reason logs and the
REAKTOR_SDL_GPU shim go (it never shipped under that name), check-abi.sh
reads no CC, and the shared comments say less.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 09:38:18 +01:00
adminandClaude Opus 5.5 29d93f9cd8 Tray: type-check EventGroup, fall back to the app id as the title
EventGroup read an id without checking its type, so a peer that sent
something else wrote past it. With no tooltip the title was empty
rather than the app id. Also: one helper each for an item and an empty
array, dbus_message_get_args where it was walked by hand, and a flush
in send_and_free instead of after it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 09:38:18 +01:00
adminandClaude Opus 5.5 2b1dc77fc6 Tray: drop the locale guard no tray needs any more
Linux and the BSDs use the D-Bus tray now, so SDL's, and the GTK
that set the locale under it, is gone from them; the guard had no
caller left there, which check-exports caught.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 23:51:19 +01:00
admin 056a3ea3b8 Merge remote-tracking branch 'origin/master' into shared-proto
# Conflicts:
#	tools/libreaktor-pkg.sh
2026-11-03 23:45:14 +01:00
adminandClaude Opus 5.5 244efd2e4b Tray: the D-Bus path on the BSDs too, and no SDL tray without dbus-1
FreeBSD, OpenBSD and NetBSD take the same StatusNotifierItem path as Linux;
their CI package lists and arm64 sysroots already carry dbus. A Linux or BSD
build without dbus-1 now has no tray instead of falling back to SDL's and GTK.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:38:40 +01:00
adminandClaude Opus 5.5 cd0fb02237 Tray: StatusNotifierItem and dbusmenu over libdbus on Linux and the BSDs
SDL's tray there loads AppIndicator, dbusmenu-gtk3 and GTK 3, which took the
showcase from 57 mapped libraries to 110 and its tray open to 79-133 ms. The
tray is now an org.kde.StatusNotifierItem with a com.canonical.dbusmenu menu
on a private session-bus connection: 57 libraries, 7-23 ms. A thread waits on
the bus socket and wakes the frame loop, which reads and answers. With no
watcher on the bus reaktor_tray_open answers 0. Windows, macOS and builds
without dbus-1 keep SDL's tray.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 15:37:37 +01:00
adminandClaude Opus 5.5 47589b0826 Merge master: TOML settings through toml-c
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 12:46:55 +01:00
adminandClaude Opus 5.5 0948611c7e Shared libreaktor prototype, measured: go at four apps
REAKTOR_SHARED_PROTO links the samples against libreaktor-proto.so, and
REAKTOR_SHARED_PROTO_HIDE exports only the public APIs. Three apps save
14.8%, four 20.4%, five 24.2%. pss.sh takes an app list and retries a
run whose app quit early; the runtime logs why it quits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 13:41:19 +01:00
adminandClaude Opus 5.5 253a55dd05 Settings: reaktor_grow, toml-c's public table API, one lookup per set
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:23:51 +01:00
adminandClaude Opus 5.5 1245b7328a Settings: TOML through toml-c instead of INI through ini.h
settings.conf becomes settings.toml, one quoted key and string per line,
read by toml-c (MIT, a maintained fork of tomlc99) and written by the
runtime. The mglibs submodule goes, with ini.h's license.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:15:03 +01:00
Roman ChojnackiandClaude Opus 5.5 2c904f245d Renderer: --renderer sdl-gpu for application shaders, and an HDR output
REAKTOR_SDL_GPU, on by default, builds SDL's GPU API and its gpu renderer:
Direct3D 12 on Windows, Metal on macOS, Vulkan on Linux and the BSDs, which
lets an application set its own shaders with SDL_CreateGPURenderState. It is
--renderer sdl-gpu, or the launch's .renderer; --renderer gpu keeps meaning a
native driver. Built in, it costs 184 KB on Windows and nothing at runtime.

The launch's .hdr, or --hdr on, makes the renderer with an scRGB output, and
secondary windows follow the main one. The software renderer, or one that
refuses it, is made SDR as before; so is SDL's gpu renderer on a display that
cannot show the linear swapchain, where it would otherwise draw everything
dark. The resize settle frame now shares the redraw switch.
Requested by PapayaPlayer (#104, items 2 and 3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 19:10:59 +01:00
Roman ChojnackiandClaude Opus 5.5 929519a168 Renderer: --renderer gpu picks a native GPU driver for each platform
metal on macOS; opengl, else direct3d12, else direct3d11 on Windows; opengl,
else opengles2 on Linux and the BSDs; opengles2 on the web. A driver left out
of the build is skipped. The documentation also says macOS builds OpenGL
whatever REAKTOR_SDL_GL says. Defaulting REAKTOR_SDL_GL on is still open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 19:10:50 +01:00
Roman ChojnackiandClaude Opus 5.5 1ea440438f CSS: linear-gradient() fills buttons and a slider's filled part
background and background-image take a two-stop linear-gradient() run to a
side or a multiple of 90deg; background-color leaves it in place, as in CSS.
reaktor_style carries it as gradient, gradient_from and gradient_to, and bg
falls back to the first stop where nothing draws it. A rounded gradient is the
corner masks cut into texel strips along the run, each tinted where it sits,
and multi-color runs between them, so its edge is as smooth as a solid fill's
on the software renderer. reaktor_fill_gradient draws one for an application.
Requested by PapayaPlayer (#104, item 1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 16:10:22 +01:00
Roman ChojnackiandClaude Opus 5.5 926cc50cd3 Resize: a new size draws a second frame, since boxes are placed a frame late
Windows sends enough events with a resize to draw twice, but the web page's
resize, and a platform that sends a single event, drew only once and left an
idle app showing the old layout until the next input. Requested by
PapayaPlayer (#104, item 4).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 15:55:14 +01:00
Roman ChojnackiandClaude Opus 5.5 23ffcba28f Tray: minimizing can hide the window there; showing it again restores it
reaktor_tray_hide_on_minimize(app, 1) hides the main window when it is
minimized while the tray icon is open. reaktor_set_visible(app, 1) now
restores a minimized window, and the showcase's Show entry uses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 22:15:48 +02:00
Roman ChojnackiandClaude Opus 5.5 7a8ae2ef3b Work done once: print warm-up, preferences, list cells, glyph state
- Printing: the warm-up frames before a page is captured build without
  rendering or presenting; only the capture frame draws. The PDF is
  byte-identical, and a two-page export takes 359 to 344 ms of CPU.
- System preferences are read once on every path; load_theme no longer
  reads them again after its caller has.
- A list row asks for its first cell once, for the accessible name and
  the drawing, and a tree row no longer asks for its label a third time.
- The software renderer asks a texture's size once per draw command,
  sets a glyph's color only when it changes, and puts the color and
  blend back once per run instead of after every rectangle. Render step:
  0.24 to 0.19 ms on Login, 0.97 to 0.85 ms on Buttons.

Pixels and --a11y-dump are unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 17:14:20 +02:00
Roman ChojnackiandClaude Opus 5.5 66129d3bc7 Atlas: each font opened once, kept for later windows; DPI, Retina and portal fixes
- The atlas bake opens each font file once instead of once per size:
  36.8 ms to 18.5 ms per bake, byte-identical output. A threaded bake
  was faster still but kept 0.5-1.1 MB the heap never returned.
- The first window after the main one keeps its atlas image and glyph
  tables; later windows and menus copy them instead of baking (about
  11 ms to 0.3 ms each). Freed when the main window rebakes or quits.
- The first window is sized by the primary display's content scale;
  reaktor_dpi_query_scale(NULL) always answered 1.0.
- Windows opened with reaktor_window_open are sized in window
  coordinates, as popups already were, so a Retina Mac no longer
  doubles them.
- Linux reads the portal's settings in one ReadAll call and stops asking
  only when there is no portal or no ReadAll; reaktor_prefers() replaces
  the two preference queries.
- The a11y tree finds a node through its hash index; sRGB to linear is a
  table; a box reads its style once; the locale scan is one pass.
- PERFORMANCE.md, the chart and the README remeasured for Reaktor.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 16:33:23 +02:00
Roman ChojnackiandClaude Opus 5.5 f1404b4193 CSS reads declarations on first match; startup timings; D3D switch and /Gw
The engine parses every selector when the sheets load and a rule's
declarations the first time a query matches it. Loading the sheets takes
0.16 ms instead of 0.35, and the first round of queries on top 0.21 ms
instead of 0.33. A sheet can be added after the others: the role sheet is
appended with reaktor_style_add instead of loading every sheet again.

Diagnostics and the Inspector show where startup goes: the window, the
font atlas and the first frame, beside the stylesheets.

REAKTOR_SDL_D3D, on by default, builds SDL's Direct3D 11 and 12 renderers;
off, a program is 105 KB smaller and draws in software only. MSVC builds
with /Gw, so unused data goes as unused functions do: 24 KB off the small
programs, 96 KB off the showcase. DOCUMENTATION steers away from direct3d11,
whose CPU is in SDL's renderer or the driver, and the chart drops it.

Against the libcss build, measured in one session with the clock pinned,
old and new alternating: private memory is 0.16-0.28 MB lower everywhere,
direct3d11 frames a little faster, and the rest the same within noise.
PERFORMANCE.md carries today's sizes, memory, frame times and WARP, with
the frame-time method written down.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 11:59:03 +02:00
Roman ChojnackiandClaude Opus 5.5 dffcce22d5 CSS: Reaktor's own engine replaces libcss, and a pass of simplifications
core/css/css.c reads the stylesheets once into typed values and cascades
them as CSS does: !important, then specificity, then source order. It takes
var(), color-mix(in srgb, ...), em and rem, calc() over pixels, the @media
features Reaktor answers, @import at the top of a sheet, :not(), :enabled,
attribute selectors read as classes, descendant and child combinators, and
escapes. Rules are bucketed by the last compound of their selector, so a
query checks only the rules that could match. cssflat.c, LCUI's libcss and
yutil, and the lcui submodule go.

Screenshots of every showcase tab, notepad and simple, light and dark, with
normal and more contrast, are byte-identical to the libcss build, with
Water.css and with Simple.css; --a11y-dump differs only in the a11y struct's
size. Three values change to what CSS says: an unset background is
transparent black, an unset border color is the text's, and Simple.css's
:enabled:hover no longer reaches a disabled button. Against libcss, loading
the sheets takes 0.35 ms instead of 1.24 and a first query 0.32 us instead
of 4.4. csstest covers the cascade, values, @media and hostile sheets: import
loops and fan-out, var() that grows or expands too often, deep calc(), a sheet
left open, a huge file. 200,000 mutated sheets ran clean under AddressSanitizer.

Simplifications: dead state (redraw_always, sw_noaa, the hover-gap pin, a
muted note, an overwritten slider range, the font-baking blocks of the SDL
renderer, the a11y change index); REAKTOR_LAY_FILL for FILL_X | FILL_Y; one
helper each for flag parsing, capture runs, timings, paths from the working
directory, array growth, focus moves, tooltips, button presses, a11y slot
probes, UIA fragments and test strings; launchtest's notef() and last_node();
the output folder set once in CMake and a write-if-changed function; one test
list, tools/ci/tests.txt, for every workflow, so basetest and imagetest run.

The showcase drops its relaunch button, an ask() button is as wide as its
label, and build.sh takes a bare target. The docs follow, and PERFORMANCE.md
and the chart carry a new pass of all seven benchmark arms on one machine.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 02:37:13 +02:00
Roman Chojnacki 9f4eefaa07 Merge remote-tracking branch 'origin/master' into drop-pdfgen
# Conflicts:
#	.gitmodules
#	CMakeLists.txt
#	docs/NOTICE.md
2026-10-23 09:56:45 +02:00
Roman ChojnackiandClaude Opus 5.5 36d4a9c9c5 Print: Reaktor writes its PDFs; PDFGen goes
A PDF here is a JPEG per page and the objects that frame it, so print.c
writes them itself: the same pages, images and info, without the font and
transparency states PDFGen added to every page. The creation date is UTC,
where PDFGen wrote local time marked as UTC, and a title past ASCII is
UTF-16.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 09:09:07 +02:00
Roman ChojnackiandClaude Opus 5.5 37988199de Fonts: FreeType reads and draws them; Nuklear's baking and stb_truetype go
core/render/font.c builds the atlas: FreeType 2.15.0 draws each glyph with
light hinting, and the metrics are Nuklear's, so layout is unchanged. The
Text module draws its fallback glyphs with FreeType too, and a font is
checked by opening it with FreeType. NK_INCLUDE_FONT_BAKING and
NK_INCLUDE_DEFAULT_FONT are off, which takes stb_truetype and stb_rect_pack
out of the build.

FreeType builds only its TrueType, CFF, autofit and smooth modules, and
reaktor_ftoption.h drops what Reaktor never reads, its environment override
among them.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-23 08:29:04 +02:00
Roman ChojnackiandClaude Opus 5.5 2d982889fc Simplify the unmerged changes and fix two of them
The tree's jump to a parent checks the parent against the tree's count, not
the list's. A font's name table is checked in reaktor_font_valid, before
Nuklear reads it, in place of the late check in text.c.

cssflat.c checks every token with one token_ok, frees in one place in
emit_one, and drops unresolved variables once. UTF-8 cleaning uses SDL's
decoder. The file dialog flag becomes file_busy, freed by reaktor_app_free.
urltest becomes basetest and holds the UTF-8 checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 23:47:08 +02:00
Roman ChojnackiandClaude Opus 5.5 010d184461 Single instance elsewhere: the /tmp fallback socket lives in a folder only the user can reach
When the settings folder's path was too long for a socket, the socket went to a name in /tmp that another user could bind first, receiving the paths a later launch sent. It now goes into /tmp/reaktor-<uid>, created 0700 and checked to be a real folder owned by the user and closed to others; if it is not, the app logs it and runs as a copy of its own.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 23:15:39 +02:00
Roman ChojnackiandClaude Opus 5.5 0d3e5b271e File dialogs: a window is freed only once its dialog's callback has finished
The callback marks its answer ready, wakes the window, then marks itself done as its last touch, but a closing window was freed once its answer had been handled, which can happen between those steps. file_done now means no callback is outstanding: it starts set, a dialog clears it, the callback sets it last, and a closing window is parked until it is set. A window freed with an answer it never handled also frees the answer's list. launchtest win-picker-close, which closes a window over its open dialog, exits cleanly.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 23:10:53 +02:00
Roman ChojnackiandClaude Opus 5.5 3f3be58ee9 Single instance on Windows: no impersonation, no paths to another user's pipe
The pipe's name can be predicted, so another account on the machine could create it first. A later launch then handed that pipe its file paths and connected at the default impersonation level, letting an account with the impersonation privilege act as the user. Launches now connect at identification level only, send nothing unless the pipe's server runs as the same user, and the listener claims the name exclusively. Whenever any of this fails, the app logs it and runs as a copy of its own.

Tested with PowerShell holding the pipe first: the showcase logged that the name was held and ran on its own, and the squatting server was granted Identification only; a normal second launch still hands over, in 184 ms.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 23:09:04 +02:00
Roman ChojnackiandClaude Opus 5.5 e46eaf2ea1 Single instance: a silent client can no longer stall forwarding or quitting
The listener read with no time limit, so a client that connected and sent nothing held it: later launches could not hand over their files, and quitting hung, since stopping the listener meant connecting to it. On Windows the pipe is now overlapped, each read waits at most 2 seconds, and a stop event ends any wait; elsewhere each connection has a 2-second receive timeout. A launch whose message never arrives no longer raises the window. Checked on Windows against master: with a silent client connected, a second launch handed over in 2.1 s instead of never, and quitting took 29 ms instead of hanging.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 22:50:36 +02:00
Roman ChojnackiandClaude Opus 5.5 d188933b49 Test harness: requests live in the harness, not on the script's stack
A lookup or settle posted to the main thread pointed into the script
thread's stack. After a 5-second timeout the script returned while the post
was still queued, and the main thread later wrote the answer into a frame
that no longer existed. Requests now use harness-owned memory, copy the
target they search for, and nothing is posted once the window has stopped
answering. uitest passes all its checks.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 22:32:00 +02:00
Roman ChojnackiandClaude Opus 5.5 22e94bef52 Direct3D 12 renderer on Windows, and --renderer directx
SDL's Direct3D 12 renderer is built on Windows, adding 62,464 bytes to each
program. --renderer directx tries direct3d12, then direct3d11. Showcase pages
draw byte-identical on direct3d12 and direct3d11 in both themes; a build
without Direct3D 12 lands directx on direct3d11.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-22 19:46:23 +02:00
admin ddb5896fd8 Merge pull request #81 from Alpaq92/ui-test
Scripted UI tests: drive an app through its accessibility tree
2026-10-22 16:03:14 +02:00
admin 40fa5063eb Merge pull request #85 from Alpaq92/small-fixes
No MSVC warnings from Reaktor's code; bench runner on PowerShell 5.1; a startup step for the app's start
2026-10-22 15:52:00 +02:00
adminandClaude Opus 5.5 52f8ac52ec Marks scope lookups and may repeat; apps that run no test link no test code
- A container takes a mark too, and "#row Delete" finds Delete only inside a
  container carrying that mark, at any depth. One mark may sit on many
  widgets (every row's Delete as "del"), so "#row1 #del" reaches that row's
  button and "#del" reports how many matched. A target that is itself a mark
  is taken whole, spaces and all.
- The mark table grows as needed and keeps 63 characters, saying once when a
  mark is cut; --a11y-dump lists marks after the tree when there are any.
- When several widgets match, the log says how many and the first is used.
- The frame loop calls the test runner through a hook only reaktor_test_app
  sets, so runtime/test.c is linked into test programs alone: showcase,
  simple, notepad and bench no longer carry it.

Found by an independent review: repeated marks resolving to their first
holder only, a mark with a space split as a scope, silent truncation at 31
characters, and silent drops past 64 marks a frame.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:45:09 +02:00
adminandClaude Opus 5.5 b442e10ab2 No MSVC warnings from Reaktor's code, bench runner on PowerShell 5.1, a startup step for the app's start
- nk_impl.c builds with /wd4116 (Nuklear's NK_ALIGNOF) and the core library
  with /wd5287 (nuklear.h's own enum arithmetic), as the showcase already did.
- benchmarks/run.ps1 holds the process handle, without which Windows
  PowerShell 5.1 reports no exit code and every arm reads as failed.
- Diagnostics' startup memory gets REAKTOR_RSS_START after the application's
  start callback, so the stylesheets line no longer carries the showcase's
  splash window and tray (+2.4 MB private there, +0.0 MB for the sheets).
- The button row of the widget table says .keys is announced, and the key
  hook binds it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:23:38 +02:00
adminandClaude Opus 5.5 88904a93ee BSD cache: record its commit only when every build finished; marks off the tree
The NetBSD arm64 showcase crashed because the first push's arm64 cross build
stopped halfway, yet the cache was saved under that run's commit. The next
run dated only the five files changed since as new, so objects the failed
build never reached were linked against the accessibility node's old layout.
The commit is now noted only when the cross build did not fail, and the cache
key moves to v2 so the bad cache is never restored.

Marks no longer sit in every accessibility node (4 KB per window, paid by
every app): they live in a table declare.c allocates when the first widget
sets one, so an application without marks pays nothing and the tree is the
size it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 15:01:37 +02:00