|
|
@@ -23,12 +23,15 @@ pub struct KioskApp {
|
|
|
|
|
|
// State
|
|
|
is_initialized: bool,
|
|
|
+ window_setup_done: bool,
|
|
|
current_user: Option<UserInfo>, // The Kiosk User
|
|
|
session_user: Option<UserInfo>, // The User currently logged in via Kiosk
|
|
|
session_token: Option<String>, // The Token of the User currently logged in via Kiosk
|
|
|
error_message: Option<String>,
|
|
|
show_full_ui: bool,
|
|
|
last_interaction: std::time::Instant,
|
|
|
+ startup_time: std::time::Instant,
|
|
|
+ delayed_fullscreen_done: bool,
|
|
|
}
|
|
|
|
|
|
impl KioskApp {
|
|
|
@@ -49,12 +52,15 @@ impl KioskApp {
|
|
|
login_view,
|
|
|
full_ui_app: Some(full_ui_app),
|
|
|
is_initialized: false,
|
|
|
+ window_setup_done: false,
|
|
|
current_user: None,
|
|
|
session_user: None,
|
|
|
session_token: None,
|
|
|
error_message: None,
|
|
|
show_full_ui: false,
|
|
|
last_interaction: std::time::Instant::now(),
|
|
|
+ startup_time: std::time::Instant::now(),
|
|
|
+ delayed_fullscreen_done: false,
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -106,6 +112,22 @@ impl KioskApp {
|
|
|
|
|
|
impl eframe::App for KioskApp {
|
|
|
fn update(&mut self, ctx: &egui::Context, frame: &mut eframe::Frame) {
|
|
|
+ // Ensure window state on first frame
|
|
|
+ if !self.window_setup_done {
|
|
|
+ if self.config.ui.fullscreen {
|
|
|
+ ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(true));
|
|
|
+ }
|
|
|
+
|
|
|
+ // Enforce fullscreen again after a short delay (to handle some window managers)
|
|
|
+ if !self.delayed_fullscreen_done && self.startup_time.elapsed().as_secs_f32() > 1.0 {
|
|
|
+ if self.config.ui.fullscreen {
|
|
|
+ ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(true));
|
|
|
+ }
|
|
|
+ self.delayed_fullscreen_done = true;
|
|
|
+ }
|
|
|
+ self.window_setup_done = true;
|
|
|
+ }
|
|
|
+
|
|
|
// Check for interaction (clicks or key presses, ignore mouse moves to prevent drift issues)
|
|
|
let has_interaction = ctx.input(|i| {
|
|
|
i.pointer.any_pressed() ||
|