Lxqt-session and autostarting applications

(Walter Lapchynski) #1

So I’m having this weird issue that seems like it might be related to the order in which applications are started in lxqt-session. In trying to investigate this further, I found the code doing the heavy lifting:

void LXQtModuleManager::startAutostartApps()
    // XDG autostart
    const XdgDesktopFileList fileList = XdgAutoStart::desktopFileList();
    QList<const XdgDesktopFile*> trayApps;
    for (XdgDesktopFileList::const_iterator i = fileList.constBegin(); i != fileList.constEnd(); ++i)
        if (i->value(QSL("X-LXQt-Need-Tray"), false).toBool())
            qCDebug(SESSION) << "start" << i->fileName();

This seems to iterate over a list of Desktop Entries and starts them, logging them as they go (and dealing with tray apps separately; I snipped that bit out). So I thought I’d look into this logging. Unfortunately, (and forgive me if I’m missing something obvious), I am not finding it anywhere. As far as I know from qDebug, at least, this should go to stderr. I’ve tried changing the call to lxqt-session in startlxqt to exec lxqt-session 2>/tmp/lxqt-session-log and was not finding any of these “start” entries at all.

The docs on qCDebug didn’t really make it clear to me as to where I should expect the output to go. Given that logging is now using QLoggingCategory, I also tried adding something like QT_LOGGING_RULES="*.debug=false,SESSION.debug=true,lxqt-session.debug=true" and looking in the debug.log to no avail. What am I missing?

Back to my original problem, it does seem in reading the code that the order of starting should be deterministic (and would be consistent with the results I have seen, which are reproducible). That said, is there a way to control the order of startup? Is this something that would be a valuable addition if not?

(Pedram Pourang) #2

I had the same question years ago but never found the time to investigate it – almost never read this part of LXQt’s code (maybe, just once). I’ll try to do read it next week.

(Walter Lapchynski) #3

Thanks. Meanwhile, do you know anything about the logging? It seems like @palinek knows something, since they are responsible for the change from qDebug.

(Pedram Pourang) #4

No; have never used/needed it in my programs. The time I get familiar with it, @palinek has answered our questions, I guess.

(palinek) #5

@wxl Yes, you’re on a good way. But the list in QT_LOGGING_RULES is separated by semicolon (based on the QT docs).

(Walter Lapchynski) #6

UGH of course it’s something obvious. That is what I needed. Thanks again!

That said, it’s clear the autostarting works as expected: in alphabetical order based on the Desktop Entry filename. I’d still love to hear opinions about controlling the order some way other than renaming said files.

Also, why don’t we use QLoggingCategory everywhere? It seems like that debug.log could be filled with all sorts of useful stuff and serve as a central repository for all of LXQt logging. We’d probably want to prepend messages with the name of the application, but… Heck, I might even be down with flipping everything from qDebug myself just based on @palinek’s example.