mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-29 17:54:59 +01:00
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).