Files
pdfcraft/docs
bmh129 4e634e4b01 M3: hand the launcher's activation token back from the first window (Linux)
A launcher with StartupNotify=true passes an activation token in
XDG_ACTIVATION_TOKEN (Wayland) or DESKTOP_STARTUP_ID (X11) and shows a
busy cursor until a window hands it back. winit hands back only a token
given through with_activation_token, and eframe never gives one, so GNOME
kept the busy cursor for 15 seconds after PdfCraft's window appeared, and
a Wayland window opened without keyboard focus.

Vendored winit patch 14: the first window created without a token takes
the environment's. Later windows don't reuse the spent token; an empty or
oversized (over 1,024 bytes) token is ignored, since on X11 an oversized
one would fail window creation. The variable stays in the environment:
removing it while other threads may read it is unsound.

Tests: startup_token's policy tests in the vendored crate (three fail with
the policy reverted) and apps/pdfcraft/tests/winit_startup_token.rs, which
keeps the patch in the build (fails with the Window::new wiring reverted).
2026-11-16 21:16:47 -06:00
..