Remove some comments
This commit is contained in:
parent
970885ec45
commit
7afd6451d2
3 changed files with 9 additions and 54 deletions
18
src/main.rs
18
src/main.rs
|
|
@ -39,7 +39,6 @@ struct Workspace {
|
|||
|
||||
struct LayerSurface {
|
||||
output: wl_output::WlOutput,
|
||||
//workspaces: Vec<Workspace>,
|
||||
// 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<Msg> {
|
|||
fn workspaces_sidebar<'a>(
|
||||
workspaces: impl Iterator<Item = &'a Workspace>,
|
||||
) -> 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<Msg> {
|
|||
}
|
||||
*/
|
||||
|
||||
// TODO create one surface per monitor?
|
||||
// TODO how to get monitor size?
|
||||
pub fn main() -> iced::Result {
|
||||
App::run(iced::Settings {
|
||||
antialiasing: true,
|
||||
|
|
|
|||
|
|
@ -127,12 +127,6 @@ impl ToplevelInfoHandler for AppData {
|
|||
_qh: &QueueHandle<Self>,
|
||||
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<Self>,
|
||||
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<Self>,
|
||||
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<zcosmic_screencopy_session_v1::FailureReason>,
|
||||
) {
|
||||
//println!("failed");
|
||||
// TODO
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue