logind accepts loginctl activate and SwitchToGreeter before the graphics stack moves the seat, and SDDM 0.21 answers SwitchToGreeter with a greeter whose logins never start a session. Each request is now confirmed within a timeout and the previous session is reactivated on failure, so no path can leave a blank VT. When nothing answers, both front-ends offer to restart display-manager.service through polkit, and only after that is the session terminated.
29 lines
1.1 KiB
C++
29 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <string>
|
|
|
|
namespace fws {
|
|
|
|
// Switches the seat to the given logind session (VT activation). The switch is
|
|
// verified and rolled back to the previous session when the seat never moves.
|
|
bool activateSession(const std::string& sessionId, std::string& error);
|
|
|
|
struct GreeterOutcome {
|
|
bool ok = false;
|
|
// True when no display manager answered and showing the greeter would end
|
|
// the current session: the caller has to confirm before retrying with
|
|
// allowTerminate = true.
|
|
bool forceRequired = false;
|
|
std::string error;
|
|
};
|
|
|
|
// Shows the display manager greeter again. GDM and LightDM are asked to switch
|
|
// without ending anything; SDDM 0.21 cannot do that safely (its SwitchToGreeter
|
|
// leaves a greeter whose logins never start a session), so the call reports
|
|
// forceRequired and the caller has to confirm first. With allowTerminate the
|
|
// session does not come back: GDM and LightDM have it terminated, and SDDM is
|
|
// restarted through polkit so a working greeter takes the seat again.
|
|
GreeterOutcome switchToGreeter(bool allowTerminate);
|
|
|
|
} // namespace fws
|