| Summary: | Docs and code for X-KDE-autostart-phase disagree. | ||
|---|---|---|---|
| Product: | [Unmaintained] kdelibs | Reporter: | John <john5342> |
| Component: | kdeinit | Assignee: | kdelibs bugs <kdelibs-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | adaptee, christoph, kevin.kofler, lukas, mss, rdieter |
| Priority: | NOR | ||
| Version First Reported In: | Git | ||
| Target Milestone: | --- | ||
| Platform: | unspecified | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
confirmed, items are starting in phase 2 autostart after session restore. I can think of lots of badness this could cause. For example, xsettings-kde starting after session-restored apps We removed kdeinit in KF6. Just for the record: The default value and the reasoning is now properly documented in https://invent.kde.org/plasma/plasma-workspace/-/blob/master/ksmserver/README (which should probably be updated to the current state without kdeinit). |
While investigating another bug (ksmserver not finishing autostart) i found the default value for "X-KDE-autostart-phase" in .desktop files is supposed to be "1" (see e.g. kdelibs/kinit/README.autostart). The code that actually loads the desktop files seems to default to 2. The end result is that any autostart file without a X-KDE-autostart-phase entry will start later than expected. Cut down copy of relevant loading code below: === // kdelibs/kdecore/util/kautostart.cpp KAutostart::StartPhase readEntry(const KConfigGroup &group, const char* key, const KAutostart::StartPhase& aDefault) { //... if (data == "0" || data == "BaseDesktop") { return KAutostart::BaseDesktop; } else if (data == "1" || data == "DesktopServices") { return KAutostart::DesktopServices; } else if (data == "2" || data == "Applications") { return KAutostart::Applications; } //... } KAutostart::StartPhase KAutostart::startPhase() const { return readEntry(d->df->desktopGroup(), "X-KDE-autostart-phase", Applications); } === I didn't know what component to file against (kdeinit or kdecore) since i don't know if it's the documentation or code that is wrong but they probably ought to agree. Reproducible: Always Steps to Reproduce: 1. Create an autostart desktop file without X-KDE-autostart-phase item. Actual Results: File is autostarted in phase 2. Expected Results: file should be autostarted in phase 1 as the docs suggest. A workaround is adding the relevant item to all desktop files that matter.