--start-hidden / "Start minimized to tray" does not hide window on startup (Linux, all configs)
State: Triagedesktop-app
**Version:** 0.104.1 (db 239, build 744646d07b)
**OS:** Fedora 44, KDE Plasma 6
**Summary:**
The autostart `.desktop` entry generates correctly and always contains `--start-hidden`. The flag itself has no effect — the window spawns fully visible on startup instead of starting hidden in the tray. Tray icon, close-to-tray, and manual tray docking all work fine; only the start-hidden path is broken.
Confirmed broken across every combination of:
- Packages: Official RPM, zadam Flatpak <-the only version on flapost?(`com.github.zadam.trilium`) and the official `TriliumNotes-v0.104.1-linux-x64.flatpak`
- Display server: native Wayland (`--ozone-platform=wayland`, confirmed via `/proc/<pid>/fd` showing wayland-cursor memfds and no `.X11-unix` socket) and XWayland (default)
- Launch path: real KDE autostart login, and manual launch
Behavior is not even consistent between attempts — sometimes spawns minimized, sometimes spawns full-screen; never starts hidden to tray.
Autostart entry is correct — regenerates cleanly on toggling "Launch on startup", always with `--start-hidden`. Options confirmed set: `launchOnStartup=true`, `hideOnAutoStart=true`, `closeToTray=true`, `disableTray=false`.
As a further data point: setting a KDE window rule to "minimize on start" for the Trilium window does minimize it correctly on startup — but then also minimizes it whenever it's reopened from the tray, making the tray icon unusable. So a window-manager-level workaround isn't viable either.
**Relevant log evidence:**
Native Wayland confirmed, clean tray registration, no errors:
```
📦 app=0.104.1 db=239 sync=39
Registered global shortcut Ctrl+Alt+P for action createNoteIntoInbox
Listening on port 37840
```
**Workaround (confirms the tray path itself is fine — bad and hacky, not a real fix):**
Launching Trilium and then force-closing its window via `kdotool` triggers the close-to-tray handler and docks it correctly:
```bash
#!/bin/bash
# ~/.local/bin/trilium-tray.sh
trilium &
for i in $(seq 1 40); do
win=$(kdotool search --class trilium 2>/dev/null | tail -1)
if [ -n "$win" ]; then
sleep 0.1
kdotool windowclose "$win"
break
fi
sleep 0.4
done
```
This is a hacky polling script that races against window creation and depends on an external tool (`kdotool`) — it's a workaround, not a fix. It does confirm the bug is isolated specifically to the `--start-hidden` startup path, since the same close-to-tray logic works fine when triggered manually.
Would appreciate a fix for `--start-hidden` so this workaround isn't necessary. Thanks!
0 条评论