diff --git a/src/windowing/mod.rs b/src/windowing/mod.rs index 25f88c4..e6e0034 100644 --- a/src/windowing/mod.rs +++ b/src/windowing/mod.rs @@ -192,8 +192,6 @@ impl WindowingSystem { femtovg_window.set_scale_factor(config.scale_factor); femtovg_window.set_position(LogicalPosition::new(0., 0.)); - //debug!("Setting up custom Slint platform"); - debug!("Creating Slint component instance"); state.set_window(Rc::clone(&femtovg_window)); @@ -208,13 +206,9 @@ impl WindowingSystem { pub fn run(&mut self) -> Result<()> { info!("Starting WindowingSystem main loop"); if let Some(window) = &self.state.window() { - /*let platform = CustomSlintPlatform::new(window); - slint::platform::set_platform(Box::new(platform)) - .map_err(|e| anyhow::anyhow!("Failed to set platform: {:?}", e))?; - */ window.render_frame_if_dirty(); } - self.state.show_component(); + self.state.show_component()?; self.setup_wayland_event_source(); self.event_loop diff --git a/src/windowing/state/mod.rs b/src/windowing/state/mod.rs index 31e91da..8cac5ff 100644 --- a/src/windowing/state/mod.rs +++ b/src/windowing/state/mod.rs @@ -1,4 +1,4 @@ -use std::{borrow::{Borrow, BorrowMut}, rc::Rc}; +use std::{rc::Rc}; use log::info; use slint::{LogicalPosition, PhysicalSize, ComponentHandle}; use slint_interpreter::{ComponentDefinition, ComponentInstance}; @@ -131,6 +131,6 @@ impl WindowState { } pub fn component_instance(&self) -> &ComponentInstance { - &self.component_instance.as_ref().unwrap() + self.component_instance.as_ref().unwrap() } }