pub struct DisplayManager {
pub current_session: Option<DisplaySession>,
pub login_screen: LoginScreen,
pub showing_login: bool,
/* private fields */
}Expand description
The display manager controls login, sessions, and VT switching.
Fields§
§current_session: Option<DisplaySession>Currently active session (if logged in).
login_screen: LoginScreenLogin screen state.
showing_login: boolWhether the display manager is showing the login screen.
Implementations§
Source§impl DisplayManager
impl DisplayManager
Sourcepub fn show_login(&mut self)
pub fn show_login(&mut self)
Show the login screen.
Sourcepub fn spawn_session(
&mut self,
session_type: SessionType,
user_id: u32,
username: &str,
) -> bool
pub fn spawn_session( &mut self, session_type: SessionType, user_id: u32, username: &str, ) -> bool
Spawn a new session for the authenticated user.
Sourcepub fn lock_session(&mut self)
pub fn lock_session(&mut self)
Lock the current session.
Sourcepub fn unlock_session(&mut self) -> bool
pub fn unlock_session(&mut self) -> bool
Unlock the current session.
Sourcepub fn handle_vt_switch(&mut self, vt_num: u8) -> bool
pub fn handle_vt_switch(&mut self, vt_num: u8) -> bool
Handle Ctrl+Alt+F1-F6 virtual terminal switching.
vt_num is 1-6.
Sourcepub fn check_idle(&mut self, current_tick: u64)
pub fn check_idle(&mut self, current_tick: u64)
Check idle timeout and auto-lock if needed.
Sourcepub fn set_auto_login(&mut self, username: &str)
pub fn set_auto_login(&mut self, username: &str)
Enable auto-login for the given user.
Sourcepub fn auto_login(&mut self) -> bool
pub fn auto_login(&mut self) -> bool
Attempt auto-login if configured.
Sourcepub fn get_vt(&self, num: u8) -> Option<&VirtualTerminal>
pub fn get_vt(&self, num: u8) -> Option<&VirtualTerminal>
Get information about a VT.
Sourcepub fn session_count(&self) -> usize
pub fn session_count(&self) -> usize
Number of active sessions.
Sourcepub fn handle_key(&mut self, key: u8) -> bool
pub fn handle_key(&mut self, key: u8) -> bool
Handle a key press, delegating to the login screen when showing.
Returns true if a session was spawned.
Source§impl DisplayManager
impl DisplayManager
Sourcepub fn create_user_session(
&mut self,
user_id: u32,
username: &str,
session_type: SessionType,
) -> Option<u64>
pub fn create_user_session( &mut self, user_id: u32, username: &str, session_type: SessionType, ) -> Option<u64>
Create a new user session on the next available VT.
VT assignment: VT7 + session_index.
Sourcepub fn switch_to_session(&mut self, target_user_id: u32) -> bool
pub fn switch_to_session(&mut self, target_user_id: u32) -> bool
Switch to a different user’s session by user ID.
The current session is preserved; the display switches to the target session’s VT.
Sourcepub fn get_sessions(&self) -> Vec<SessionInfo>
pub fn get_sessions(&self) -> Vec<SessionInfo>
Get information about all active sessions for the DM UI.
Sourcepub fn logout_user(&mut self, user_id: u32)
pub fn logout_user(&mut self, user_id: u32)
Handle user logout: clean up session and return to login screen.