#346: FreeBSD's desktop entry matches the window class there (the binary's name)

This commit is contained in:
bflatastic
2026-10-15 19:02:40 +07:00
parent 370d9f7adc
commit e100c165fb
2 changed files with 7 additions and 2 deletions
+2
View File
@@ -177,6 +177,8 @@ fn main() -> eframe::Result {
control_server::start(p, queue.clone(), ctx_slot.clone());
}
let icon = services::window_icon();
// The app id is the Wayland app_id and the X11 window class on Linux: the desktop entry's name
// and StartupWMClass (FreeBSD's package matches the binary's name instead).
let mut viewport = egui::ViewportBuilder::default()
.with_title("FigCraft")
.with_app_id("ai.storyteller.figcraft")
+5 -2
View File
@@ -76,8 +76,11 @@ for b in "${BINS[@]}"; do
install -m 755 "$BIN/$b" "$STAGE/bin/"
strip "$STAGE/bin/$b" 2>/dev/null || true
done
# The desktop entry, MIME type, metainfo and icons are the freedesktop files Linux ships.
install -m 644 "$LINUX/$APP_ID.desktop" "$STAGE/share/applications/$APP_ID.desktop"
# The desktop entry, MIME type, metainfo and icons are the freedesktop files Linux ships. The
# window's X11 class is the binary's name here (egui-winit names the window after the app id on
# Linux only), so the entry matches that.
sed -e "s/^StartupWMClass=.*/StartupWMClass=figcraft/" "$LINUX/$APP_ID.desktop" >"$STAGE/share/applications/$APP_ID.desktop"
chmod 644 "$STAGE/share/applications/$APP_ID.desktop"
install -m 644 "$LINUX/$APP_ID.mime.xml" "$STAGE/share/mime/packages/$APP_ID.xml"
sed -e "s/@VERSION@/$VERSION/g" -e "s/@DATE@/$FIGCRAFT_BUILD_DATE/g" \
"$LINUX/$APP_ID.metainfo.xml.in" >"$STAGE/share/metainfo/$APP_ID.metainfo.xml"