⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

DisplayManager

Struct DisplayManager 

Source
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: LoginScreen

Login screen state.

§showing_login: bool

Whether the display manager is showing the login screen.

Implementations§

Source§

impl DisplayManager

Source

pub fn new() -> Self

Create a new display manager with 6 virtual terminals.

Source

pub fn show_login(&mut self)

Show the login screen.

Source

pub fn spawn_session( &mut self, session_type: SessionType, user_id: u32, username: &str, ) -> bool

Spawn a new session for the authenticated user.

Source

pub fn lock_session(&mut self)

Lock the current session.

Source

pub fn unlock_session(&mut self) -> bool

Unlock the current session.

Source

pub fn handle_vt_switch(&mut self, vt_num: u8) -> bool

Handle Ctrl+Alt+F1-F6 virtual terminal switching.

vt_num is 1-6.

Source

pub fn check_idle(&mut self, current_tick: u64)

Check idle timeout and auto-lock if needed.

Source

pub fn set_auto_login(&mut self, username: &str)

Enable auto-login for the given user.

Source

pub fn auto_login(&mut self) -> bool

Attempt auto-login if configured.

Source

pub fn active_vt(&self) -> u8

Get the active VT number.

Source

pub fn get_vt(&self, num: u8) -> Option<&VirtualTerminal>

Get information about a VT.

Source

pub fn session_count(&self) -> usize

Number of active sessions.

Source

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

pub fn render(&mut self, buf: &mut [u32], width: u32, height: u32)

Render the display manager (login screen or nothing if session active).

Source§

impl DisplayManager

Source

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.

Source

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.

Source

pub fn get_sessions(&self) -> Vec<SessionInfo>

Get information about all active sessions for the DM UI.

Source

pub fn logout_user(&mut self, user_id: u32)

Handle user logout: clean up session and return to login screen.

Trait Implementations§

Source§

impl Debug for DisplayManager

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DisplayManager

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for DisplayManager

§

impl RefUnwindSafe for DisplayManager

§

impl Send for DisplayManager

§

impl Sync for DisplayManager

§

impl Unpin for DisplayManager

§

impl UnwindSafe for DisplayManager

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.