From 6b7d9169142936a42f2eb614981d4ab09980abdb Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 16 Mar 2024 00:14:44 +0100 Subject: [PATCH] Make autostart entry for GNU/Linux more robust * Add `--wait` parameter so Syncthing Tray will wait until the tray becomes available; this might help if Syncthing Tray is started by the desktop environment before the tray is available (unless it is started too soon even for that) * Add `X-LXQt-Need-Tray=true` to ensure the system tray is available on LXQt because just `--wait` might not be sufficient here (according to https://github.com/Martchus/syncthingtray/issues/240); this is in-line with the autostart entry of https://github.com/lxqt/lxqt-powermanagement --- syncthingwidgets/settings/settingsdialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/syncthingwidgets/settings/settingsdialog.cpp b/syncthingwidgets/settings/settingsdialog.cpp index 93b8d9e..d5c481f 100644 --- a/syncthingwidgets/settings/settingsdialog.cpp +++ b/syncthingwidgets/settings/settingsdialog.cpp @@ -922,12 +922,13 @@ bool setAutostartPath(const QString &path) "Name=" APP_NAME "\n" "Exec=\""); desktopFile.write(path.toUtf8()); - desktopFile.write("\" qt-widgets-gui --single-instance\nComment=" APP_DESCRIPTION "\n" + desktopFile.write("\" qt-widgets-gui --single-instance --wait\nComment=" APP_DESCRIPTION "\n" "Icon=" PROJECT_NAME "\n" "Type=Application\n" "Terminal=false\n" "X-GNOME-Autostart-Delay=0\n" - "X-GNOME-Autostart-enabled=true"); + "X-GNOME-Autostart-enabled=true\n" + "X-LXQt-Need-Tray=true\n"); return desktopFile.error() == QFile::NoError && desktopFile.flush(); } else {