Bug 325155 - Docs and code for X-KDE-autostart-phase disagree.
Summary: Docs and code for X-KDE-autostart-phase disagree.
Status: CONFIRMED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: kdeinit (show other bugs)
Version: Git
Platform: unspecified Linux
: NOR minor
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-09-21 22:34 UTC by John
Modified: 2023-09-18 11:29 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John 2013-09-21 22:34:45 UTC
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.
Comment 1 Rex Dieter 2013-12-07 15:20:25 UTC
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