Skip to content

fix(platform): make overlays, the layer host and the virtual desktop follow the window host, and fix Windows, Linux and tray drift - #1222

Merged
Hona merged 13 commits into
devfrom
fix-platform-drift
Nov 19, 2026
Merged

Hona merged 13 commits into
devfrom
fix-platform-drift

Conversation

@Hona

@Hona Hona commented Nov 19, 2026

Copy link
Copy Markdown
Member

Rune runs one runtime under several hosts: the window host, overlays, the Apple layer host, the headless driver, the virtual desktop and the web host. An audit found places where one host did something the others do differently by accident, and a few platform bugs beside them. Each fix has a test, and each user-visible one has an entry in changelog/unreleased/.

Hosts

Before Cause Now
A resting overlay's animations jump when a frame cannot be shown the overlay stepped the runtime for the frame, then again when the drawable was missed one step per missed frame, tracked per loop turn as the window host does
Overlays ignore the wheel, pinch, rotate, touch, right and other buttons, Ctrl+click and IME; pointer positions ignore Cx::zoom the overlay host translated a subset of window events itself input::host_events, shared with the window host
A --desktop run ignores zoom and scripted resizes, and keeps keys held after its window hides its own copy of the headless driver's script translation tooling::script_input, shared with the headless driver
embed::LayerHost advances animations on a frame with no drawable, never reports presentation, skips El::surface and blend changes, and panics on a refused surface configuration a hand-written frame sequence the window host's order: acquire, step, build surfaces, draw, present, report

Event translation before, by host (✓ handled, – dropped):

Event Window Overlay Virtual desktop
Pointer under zoom ✓ – –
Wheel, with Shift swap and phase ✓ – unscaled
Pinch, rotate, smart magnify ✓ – ✓
Touch ✓ – n/a
Right and other buttons, Ctrl+click ✓ – ✓
IME ✓ – n/a
Reset on hide and blur ✓ partial –

All three are ✓ after. The web host's translation has the same kind of gaps (zoom, wheel phase, key repeat) and is not changed here.

Windows

Before Now
After a resize, a blend switch or a replaced swap chain, a frame can wait up to 100 ms on the old swap chain's latency object Slot records the configure generation and the waitable it waits on, and frees itself when either changes
A frame timer firing inside a menu or drag loop re-enters the frame; nested menus share a timer id; window subclasses use a raw pointer across nested calls a re-entrancy guard, a timer id per guard, and an owned Rc held across DefSubclassProc and released on WM_NCDESTROY
dcomp.dll loaded by bare name through the default search order LOAD_LIBRARY_SEARCH_SYSTEM32, as every other system library
Tray labels turn & and tabs into mnemonics and columns; a long tooltip is cut inside a surrogate pair escaped, and cut on a character boundary

Linux

Before Now
Layer-shell overlays do not report keyboard focus, lose held modifiers on a keymap reload, emit chords for NUL and space, and ask for keys regardless of KeyPolicy a focus state machine in platform/layer_shell_machine.rs, tested off Linux
With no portal, the appearance watcher holds a thread forever; each file dialog starts a thread and a runtime; request tokens can collide; a reply sent before the subscription is missed platform/portal.rs: one worker, monotonic tokens, subscribe before call, cancellation
Tray labels turn _ into a mnemonic escaped

Elsewhere

  • macOS cursor. The mapping to NSCursor had two wildcard arms. It is now an exhaustive match, so a new Cursor variant cannot fall through to the arrow unnoticed. No cursor changes.
  • Spellcheck. en-AU and en_US find the dictionary for their language; on web, a deselected language stops being checked.

Verification

Compiled and tested on macOS (297 tests in the touched modules), and checked for iOS, Linux with and without dbus and with native-file-dialog, and wasm. The Linux portal and layer-shell paths are compiled and unit-tested through their extracted state machines, not run on a Linux desktop.

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