diff --git a/src/windowing/mod.rs b/src/windowing/mod.rs index 6ca566d..5938ebf 100644 --- a/src/windowing/mod.rs +++ b/src/windowing/mod.rs @@ -16,7 +16,7 @@ use smithay_client_toolkit::reexports::{ use state::builder::WindowStateBuilder; use std::rc::Rc; use wayland_client::{ - globals::{registry_queue_init, GlobalList}, + globals::registry_queue_init, protocol::{ wl_compositor::WlCompositor, wl_display::WlDisplay, wl_output::WlOutput, wl_seat::WlSeat, wl_surface::WlSurface, diff --git a/src/windowing/state/builder.rs b/src/windowing/state/builder.rs index c2000da..943725f 100644 --- a/src/windowing/state/builder.rs +++ b/src/windowing/state/builder.rs @@ -8,7 +8,6 @@ use anyhow::Result; use super::WindowState; -#[derive(Clone)] pub struct WindowStateBuilder { pub component_definition: Option, pub surface: Option>, @@ -23,19 +22,8 @@ pub struct WindowStateBuilder { } impl WindowStateBuilder { - pub const fn new() -> Self { - Self { - component_definition: None, - surface: None, - layer_surface: None, - size: None, - output_size: None, - pointer: None, - window: None, - scale_factor: 1.0, - height: 30, - exclusive_zone: -1, - } + pub fn new() -> Self { + Default::default() } pub fn surface(mut self, surface: Rc) -> Self { @@ -96,3 +84,20 @@ impl WindowStateBuilder { WindowState::new(self) } } + +impl Default for WindowStateBuilder { + fn default() -> Self { + Self { + component_definition: None, + surface: None, + layer_surface: None, + size: None, + output_size: None, + pointer: None, + window: None, + scale_factor: 1.0, + height: 30, + exclusive_zone: -1, + } + } +}