KService: deprecate KAutostart
Open, Needs TriagePublic

Related Objects

StatusAssignedTask
OpenNone
Openalex
mart created this task.Nov 23 2019, 4:59 PM
dfaure added a subscriber: dfaure.Nov 23 2019, 5:01 PM

KAutostart autostart done by ksmserver now, should be deprecated and moved to plasma-workspace. (plasma-desktop/kcms/lookandfeel/kcm.cpp can be ported to KDesktopFile for writing that one file).

KAutoStart also exposes KAutostart::isStartConditionMet, which is used by Plasma.

X-KDE-autostart-condition is only used by a handful apps to toggle autostart according to some config entry. I think this is better done by the Hidden entry in the autostart desktop file, so I'd suggest to deprecate that too

It's more than "a handful" though.
I repaired lxr after noticing many desktop files were not being indexed, and it shows that this is used by:
kup, calindac, baloo_file, konqy_preload, kmix, rsibreak, klipper, kalarm, korgac, and kgpg
That's a large number of apps to adapt to toggling the Hidden key at runtime, no?

https://lxr.kde.org/search?_filestring=&_string=X-KDE-autostart-condition

alex added a subscriber: alex.Jun 25 2021, 5:55 PM

That's a large number of apps to adapt to toggling the Hidden key at runtime, no?

Agreed, but does this only mean we need this class in plasma-workspace?

Could importing this class in plasma-workspace be a good solution?

dfaure added a subscriber: ervin.Jun 25 2021, 8:09 PM

plasma-workspace is a workspace, not a provider of library for the above applications.

This however fits into @ervin 's reasoning of what "Plasma API" is, if I'm not mistaken.
According to Nicolas Fella, applications use KAutostart to control whether it should be autostarted by Plasma (not by Windows, macOS, or even Gnome). So if it's that much plasma-specific, it should come from a plasma-related library (framework) indeed.

However if this is done by toggling Hidden=true it would also work on other free desktops, no? In which case it's still Linux specific but no longer Plasma-specific....

alex added a comment.Jun 25 2021, 8:11 PM

plasma-workspace is a workspace, not a provider of library for the above applications.

Yes, and my point is that because we only use it in plasma-workspace we could import it there and just use it internally. Not any kind of public lib.

KAutostart is only used in p-w, not anyapplications. apps don't need/use that to interact with X-KDE-autostart-condition

Oh, my bad. Coming back to an old discussion, I misinterpreted some old comments (mine included).

Sure, let's move it then.

There's just one app who contradicts the above? https://lxr.kde.org/source/utilities/mangonel/Config.cpp (search for KAutostart)

alex added a comment.EditedJun 25 2021, 8:28 PM

But couldn't that app use the X-KDE-autostart-condition property to set that? Or would that not work, because it should also be autostarted on other desktops. (I think this app came up in the KGlobalAccel discussion). The KAutostart API that is used copies the desktop file to the ~/.config/autostart dir and toggles the visibility value.

IMHO a valid usage, but nothing I would block over

alex added a comment.Jul 11 2021, 4:49 PM

But the question is if we really all apps to use the KDE specific mechanism. Maybe in the future one wants to autostart apps on desktops other than KDE or even other platforms. Especially with KService becoming a platform abstraction.

alex moved this task from Backlog to Waiting on KF6 Branching on the KF6 board.Sep 18 2021, 9:41 AM
alex claimed this task.

On the KF6 weekly we agreed that is we want to have platform independent autostart we need a different API anyways.

Deprecated with:
https://invent.kde.org/frameworks/kservice/-/commit/362951e118976a17acc8ba739854eed85c13d399

Imported in pw with:
https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1004

vkrause moved this task from Waiting on KF6 Branching to Done on the KF6 board.Jan 29 2023, 2:23 PM