diff --git a/Cargo.toml b/Cargo.toml index 6994770..585ef56 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,8 +6,12 @@ edition = "2021" [dependencies] cctk = { package = "cosmic-client-toolkit", git = "https://github.com/pop-os/cosmic-protocols" } futures-channel = "0.3.25" -iced = { git = "https://github.com/pop-os/libcosmic", features = ["tokio"] } -iced_native = { git = "https://github.com/pop-os/libcosmic" } -iced_sctk = { git = "https://github.com/pop-os/libcosmic" } -libcosmic = { git = "https://github.com/pop-os/libcosmic" } +# iced = { git = "https://github.com/pop-os/libcosmic", features = ["tokio"] } +# iced_native = { git = "https://github.com/pop-os/libcosmic" } +# iced_sctk = { git = "https://github.com/pop-os/libcosmic" } +# libcosmic = { git = "https://github.com/pop-os/libcosmic" } +iced = { path = "/home/ian/src/pop/libcosmic/iced", features = ["tokio"] } +iced_native = { path = "/home/ian/src/pop/libcosmic/iced/native" } +iced_sctk = { path = "/home/ian/src/pop/libcosmic/iced/sctk" } +libcosmic = { path = "/home/ian/src/pop/libcosmic" } tokio = "1.23.0" diff --git a/src/main.rs b/src/main.rs index 34df5ff..25fff5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,6 @@ struct Workspace { struct LayerSurface { output: wl_output::WlOutput, - //workspaces: Vec, // Active workspace // windows in workspace // - for transitions, would need windows in more than one workspace @@ -79,28 +78,23 @@ impl Application for App { Msg::WaylandEvent(evt) => match evt { WaylandEvent::Output(evt, output) => match evt { OutputEvent::Created(Some(info)) => { - //println!("Create: {:?}", output); if let Some((width, height)) = info.logical_size { let id = self.next_surface_id(); self.layer_surfaces.insert( id.clone(), LayerSurface { output: output.clone(), - //workspaces: Vec::new(), }, ); - // /* return get_layer_surface(SctkLayerSurfaceSettings { id, keyboard_interactivity: KeyboardInteractivity::Exclusive, - //keyboard_interactivity: KeyboardInteractivity::None, namespace: "workspaces".into(), layer: Layer::Overlay, size: Some((Some(width as _), Some(height as _))), output: IcedOutput::Output(output), ..Default::default() }); - // */ } } OutputEvent::Removed => { @@ -126,11 +120,6 @@ impl Application for App { // XXX removal self.workspaces = Vec::new(); for (output, workspace) in workspaces { - /* - if output != &surface.output { - continue; - } - */ self.workspaces.push(Workspace { name: workspace.name, handle: workspace.handle, @@ -138,11 +127,10 @@ impl Application for App { img: None, }); println!("add workspace"); - // Oh, set workspaces before surfaces created? } } wayland::Event::WorkspaceCapture(workspace, image) => { - // XXX performanc + // XXX performance for i in &mut self.workspaces { if &i.handle == &workspace { i.img = Some(image.clone()); @@ -152,7 +140,6 @@ impl Application for App { } } Msg::Close => { - //println!("Close"); std::process::exit(0); } Msg::Closed(_) => {} @@ -226,7 +213,6 @@ fn workspace_sidebar_entry(workspace: &Workspace) -> cosmic::Element { fn workspaces_sidebar<'a>( workspaces: impl Iterator, ) -> cosmic::Element<'a, Msg> { - //println!("{:?}", workspaces); iced::widget::column(workspaces.map(workspace_sidebar_entry).collect()).into() // New workspace } @@ -243,8 +229,6 @@ fn window_previews(windows: &[Window]) -> cosmic::Element { } */ -// TODO create one surface per monitor? -// TODO how to get monitor size? pub fn main() -> iced::Result { App::run(iced::Settings { antialiasing: true, diff --git a/src/wayland.rs b/src/wayland.rs index 2185ba9..b737bb1 100644 --- a/src/wayland.rs +++ b/src/wayland.rs @@ -127,12 +127,6 @@ impl ToplevelInfoHandler for AppData { _qh: &QueueHandle, toplevel: &zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1, ) { - /* - println!( - "New toplevel: {:?}", - self.toplevel_info_state.info(toplevel).unwrap() - ); - */ } fn update_toplevel( @@ -141,12 +135,6 @@ impl ToplevelInfoHandler for AppData { _qh: &QueueHandle, toplevel: &zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1, ) { - /* - println!( - "Update toplevel: {:?}", - self.toplevel_info_state.info(toplevel).unwrap() - ); - */ } fn toplevel_closed( @@ -155,12 +143,6 @@ impl ToplevelInfoHandler for AppData { _qh: &QueueHandle, toplevel: &zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1, ) { - /* - println!( - "Closed toplevel: {:?}", - self.toplevel_info_state.info(toplevel).unwrap() - ); - */ } } @@ -173,15 +155,7 @@ impl WorkspaceHandler for AppData { let mut workspaces = Vec::new(); for group in self.workspace_state.workspace_groups() { - /* - println!( - "Group: capabilities: {:?}, output: {:?}", - &group.capabilities, &group.output - ); - */ for workspace in &group.workspaces { - //println!("{:?}", &workspace); - if let Some(output) = group.output.as_ref() { workspaces.push((output.clone(), workspace.clone())); @@ -222,10 +196,6 @@ impl ScreencopyHandler for AppData { session: &zcosmic_screencopy_session_v1::ZcosmicScreencopySessionV1, buffer_infos: &[BufferInfo], ) { - //println!("init_done"); - // TODO BIND - - // XXX let buffer_info = buffer_infos .iter() .find(|x| { @@ -280,8 +250,6 @@ impl ScreencopyHandler for AppData { ); } } - //println!("ready"); - // TODO } fn failed( @@ -291,7 +259,6 @@ impl ScreencopyHandler for AppData { session: &zcosmic_screencopy_session_v1::ZcosmicScreencopySessionV1, reason: WEnum, ) { - //println!("failed"); // TODO } }