#pragma once #include 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