[ksmserver] Create a dedicated binary from KSMShutdownDlg
ClosedPublic

Authored by graesslin on Jul 22 2016, 8:10 AM.

Details

Summary

The idea behind this change is to have a dedicated binary for the
logout dialog. As a follow up ksmserver needs to be adjusted to invoke
the helper binary instead of interacting with KSMShutdownDlg directly.

This will bring quite some improvements to the logout architecture:

  • ksmserver doesn't need to run a QEventLoop to wait for the dialog to finish
  • it becomes easier to test changes for the logout dialog, one doesn't need to restart the session any more
  • ksmserver becomes better guarded against problems in the UI layer (e.g. OpenGL errors)
  • the binary can be changed to support Wayland
  • ksmserver becomes better guarded against problems with updating Qt while the session is running

This change only introduces the creation of the binary. A new sub-dir
"logout-greeter" is added which creates a ksmserver-logout-greeter.
The greeter defines various command line arguments for the options which
are being passed to the KSMShutdownDlg.

If the dialog returns an exit value of 0 it is interpreted as accepted.
A return value != 0 indicates that the user rejected the logout.

The dialog also passes additional values back. In particular the logout
method might be changed and returned back to ksmserver. To support this
operation a pipe filedescriptor can be passed to the greeter. If present
the greeter will write the numerical value of KWorkspace::ShutdownType
into the pipe on success.

To indicate how the interaction - especially the reading from pipe -
works, the change comes with an additional test binary. It forwards
the command line arguments and creates the pipe to pass to the greeter
and reads it back in a helper thread to be non-blocking. This approach is
inspired from kwin_wayland's starting of Xwayland.

Test Plan

See the new test binary

Diff Detail

Repository
R120 Plasma Workspace
Branch
ksmserver-logout-greeter
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin updated this revision to Diff 5405.Jul 22 2016, 8:10 AM
graesslin retitled this revision from to [ksmserver] Create a dedicated binary from KSMShutdownDlg.
graesslin updated this object.
graesslin edited the test plan for this revision. (Show Details)
graesslin added a reviewer: Plasma.
Restricted Application added a project: Plasma. · View Herald TranscriptJul 22 2016, 8:10 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
graesslin updated this revision to Diff 5415.Jul 22 2016, 9:29 AM

Small change in the test binary on when to read from the pipe

This revision was automatically updated to reflect the committed changes.