Skip to content

fix(winit): keep Linux Wayland presentation responsive - #156

Merged
zcourts merged 2 commits into
fission-ui:mainfrom
zcourts:fix/linux-wayland-frame-presentation-upstream
Aug 2, 2026
Merged

fix(winit): keep Linux Wayland presentation responsive#156
zcourts merged 2 commits into
fission-ui:mainfrom
zcourts:fix/linux-wayland-frame-presentation-upstream

Conversation

@zcourts

@zcourts zcourts commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Summary

  • detect Linux Wayland from the active native event loop
  • defer the eager startup clear to the normal first redraw on Wayland
  • prefer Mailbox only when the surface advertises it, with AutoVsync as the fallback
  • omit the Wayland frame-callback hint that can suppress every subsequent redraw on affected compositors, while preserving notify-before-commit on all other native targets
  • leave Web and WebGPU presentation unchanged

Why

The native shell currently presents a clear frame synchronously from Event::Resumed and configures every surface with AutoVsync. On affected Linux Wayland software/composited WSI paths, that eager FIFO-backed presentation can wait in compositor dispatch and starve the same event loop needed to service it. After the first mapped frame, the Wayland frame callback installed by Window::pre_present_notify can also leave later RedrawRequested events throttled indefinitely when the callback is not delivered.

The winit 0.30.13 documentation specifies that pre_present_notify schedules this throttling callback on Wayland and is unsupported on the other native targets. The wgpu 26 present-mode documentation shows that AutoVsync selects FIFO/FIFO-relaxed, while Mailbox uses a replaceable single-frame queue without tearing. A related wgpu blocking report also records AutoVsync blocking behavior and a Mailbox workaround.

Fission already bounds redraw requests through its invalidation and frame scheduler, so this Wayland-specific callback opt-out does not introduce an idle busy loop.

Scope

Only Linux Wayland changes behavior. X11 and every other native target retain AutoVsync and notify-before-commit. Wayland surfaces without advertised Mailbox support retain AutoVsync. Web/WebGPU code paths are untouched.

Validation

  • focused unit tests cover startup deferral, capability-gated Mailbox selection and fallback, Wayland callback omission, and non-Wayland notify-before-commit ordering
  • native ARM64 KDE Wayland with llvmpipe/Vulkan completed repeated semantic-tree reads and redraw pumps, two screenshot captures, and three navigation loops without a stall
  • the frame trace advanced through 57 redraws, the process remained live after the sequence, and captured frames were complete with no blank, torn, or partial presentation

@zcourts
zcourts merged commit 83eff82 into fission-ui:main Aug 2, 2026
4 checks passed
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