KLauncher: handle processes exiting without error
ClosedPublic

Authored by ahmadsamir on Jan 8 2019, 9:19 AM.

Details

Reviewers
dfaure
Summary

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.

BUG: 389678
FIXED-IN: 5.55.0

Test Plan

Before applying the diff:

  • set kate to "manually choose a session" on startup and add a kate widget to the desktop/panel and start kate from that widget
  • in the session chooser dialog, select quit (or close in newer versions)
  • an error message is displayed "KDEInit could not launch /usr/bin/kate"

Diff Detail

Repository
R303 KInit
Branch
klauncher-kateSessionManager (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 6848
Build 6866: arc lint + arc unit
ahmadsamir created this revision.Jan 8 2019, 9:19 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptJan 8 2019, 9:19 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
ahmadsamir requested review of this revision.Jan 8 2019, 9:19 AM
ahmadsamir updated this revision to Diff 48948.Jan 8 2019, 9:23 AM
ahmadsamir edited the summary of this revision. (Show Details)

Fix commit message

Looks good. This assumes that no process exits cleanly (code 0) while not showing anything to the user, but even if that happened, better no klauncher error in that case, than an error in a normal case like the kate one.

src/klauncher/klauncher.cpp
340

To make this less scary (since it's not an error) I would suggest

<< "exited without error, request done. status=" <<
ahmadsamir updated this revision to Diff 49063.Jan 9 2019, 10:08 AM
ahmadsamir retitled this revision from KLauncher: handle process dying with exitStatus 0 to KLauncher: handle processes exiting without error.
ahmadsamir edited the summary of this revision. (Show Details)

Make commit and debug messages less scary, i.e. exit instead of die

ahmadsamir marked an inline comment as done.Jan 9 2019, 10:09 AM
ahmadsamir added inline comments.
src/klauncher/klauncher.cpp
340

Good point. Done.

ahmadsamir marked 2 inline comments as done.Jan 9 2019, 10:09 AM

I don't have commit access, so please commit the diff.

Thanks.

dfaure accepted this revision.Feb 2 2019, 10:54 AM

Sorry for the delay

This revision is now accepted and ready to land.Feb 2 2019, 10:54 AM