From ea1df6e1cb3ae0a8b7ad19bd8c19352de19705d0 Mon Sep 17 00:00:00 2001 From: Atos Lins <132598646+atoslins@users.noreply.github.com> Date: Sun, 11 Oct 2026 13:02:18 -0300 Subject: [PATCH] Linux: StartupWMClass is the window's app id (#1087) * Linux: StartupWMClass is the window's app id The desktop entry said StartupWMClass=pdfcraft, but the window carries the app id ai.storyteller.pdfcraft (APP_ID) on Wayland and under X11 alike, so nothing that matches a window to its launcher by that key ever matched it: on X11 the launch's startup notification can't end when the window maps. VectorCraft, GridCraft and WordCraft already use the app id. A test reads the entry and compares it with APP_ID. * Contributors: add atoslins (Atos Lins) --------- Co-authored-by: Brandon Thomas --- apps/pdfcraft/src/main.rs | 9 +++++++++ contributors/people.toml | 5 +++++ packaging/linux/ai.storyteller.pdfcraft.desktop | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/apps/pdfcraft/src/main.rs b/apps/pdfcraft/src/main.rs index a1cfd4b3..f046399a 100644 --- a/apps/pdfcraft/src/main.rs +++ b/apps/pdfcraft/src/main.rs @@ -1173,4 +1173,13 @@ mod tests { } let _ = std::fs::remove_dir_all(&dir); } + + /// X11 startup notification and docks match a window to its launcher by `StartupWMClass`, + /// so it has to be the class the window carries: the app id, on Wayland and X11 alike. + #[test] + fn the_desktop_entry_names_the_window_class() { + let entry = include_str!("../../../packaging/linux/ai.storyteller.pdfcraft.desktop"); + let class = entry.lines().find_map(|line| line.strip_prefix("StartupWMClass=")); + assert_eq!(class, Some(super::APP_ID)); + } } diff --git a/contributors/people.toml b/contributors/people.toml index 3f346cd5..c88e9159 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -79,3 +79,8 @@ sync_github_name = true real_name = "Bryan Mark" display_name = "Arcanii" sync_github_name = false + +[people.atoslins] +real_name = "Atos Lins" +display_name = "Atos Lins" +sync_github_name = false diff --git a/packaging/linux/ai.storyteller.pdfcraft.desktop b/packaging/linux/ai.storyteller.pdfcraft.desktop index f7928d62..1e091ba0 100644 --- a/packaging/linux/ai.storyteller.pdfcraft.desktop +++ b/packaging/linux/ai.storyteller.pdfcraft.desktop @@ -8,7 +8,7 @@ TryExec=pdfcraft Icon=ai.storyteller.pdfcraft Terminal=false StartupNotify=true -StartupWMClass=pdfcraft +StartupWMClass=ai.storyteller.pdfcraft Categories=Office;Viewer; Keywords=pdf;viewer;editor;annotate;sign;forms;merge;split; MimeType=application/pdf;