Bug 389678

Summary: KDEINit error on quit in session chooser
Product: [Frameworks and Libraries] frameworks-kinit Reporter: Alan Prescott <alanjprescott>
Component: generalAssignee: David Faure <faure>
Status: RESOLVED FIXED    
Severity: minor CC: a.samirh78, kdelibs-bugs-null, nate, plasma-bugs-null
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.55.0
Sentry Crash Report:

Description Alan Prescott 2018-01-31 09:54:28 UTC
Kate launched from an icon as `kate -b %U`, brings up the session chooser window. If I click on Quit I get an error message 'KDEInit could not launch /usr/bin/kate'.
Comment 1 CnZhx 2018-11-20 14:08:13 UTC
I also think this error message is not necessary and the error prompt flow should be handled more properly.

This issue still exists for Kate 18.08.3 so I changed the version from 17.04.2 to 18.08.3.
Comment 2 Ahmad Samir 2018-12-25 11:55:55 UTC
Error message comes from plasmashell, reassigning.
Comment 3 David Edmundson 2018-12-26 23:31:14 UTC
Plasmashell just runs whatever is in the exec line via KRun.

It's not us. Check your return values.
Comment 4 Ahmad Samir 2019-01-08 09:21:22 UTC
Right, I should have checked properly, sorry about that.

I think it's a problem with klauncher; when opening kate from a widget on the panel/desktop, the user could get the session chooser dialog, which is shown before the main kate app event loop is started at all, and so KLauncher::matchesPendingRequest() will always return false as the appId hasn't been changed from the unique :x.xxx to org.kde.kate; when the user quits/closes the dialog without starting kate, klauncher thinks the process has died and displays the error message in question.

I think one way to fix the issue is to set the request as done when the exitStatus is 0:
https://phabricator.kde.org/D18089
Comment 5 David Faure 2019-02-02 10:54:16 UTC
Git commit c29988a97b3ae7abc0d196a1166eb16ee6c3fa95 by David Faure, on behalf of Ahmad Samir.
Committed on 02/02/2019 at 10:54.
Pushed by dfaure into branch 'master'.

KLauncher: handle processes exiting without error

When a process exits without error (exitStatus=0), it could well be the
app exited cleanly, and there's no need to display an error message.

For example starting kate from a widget on the panel/desktop, where it
shows the session chooser dialog before ever entering the main app event
loop, then quitting/closing the dialog without starting kate. In a case
like that matchesPendingRequest() will always return false as the service
name hasn't (and won't) been changed from the unique :x.xxx to org.kde.kate.
FIXED-IN: 5.55.0

M  +8    -1    src/klauncher/klauncher.cpp

https://commits.kde.org/kinit/c29988a97b3ae7abc0d196a1166eb16ee6c3fa95