WIP activate workspace
This commit is contained in:
parent
4abedacdfa
commit
4af2d4d669
2 changed files with 18 additions and 9 deletions
22
src/main.rs
22
src/main.rs
|
|
@ -52,9 +52,9 @@ struct Toplevel {
|
||||||
struct LayerSurface {
|
struct LayerSurface {
|
||||||
output: wl_output::WlOutput,
|
output: wl_output::WlOutput,
|
||||||
output_name: Option<String>,
|
output_name: Option<String>,
|
||||||
// Active workspace
|
active_workspace: Option<zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1>,
|
||||||
// windows in workspace
|
// for transitions, would need windows in more than one workspace? But don't capture all of
|
||||||
// - for transitions, would need windows in more than one workspace
|
// them all the time every frame.
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|
@ -99,6 +99,7 @@ impl Application for App {
|
||||||
LayerSurface {
|
LayerSurface {
|
||||||
output: output.clone(),
|
output: output.clone(),
|
||||||
output_name: info.name,
|
output_name: info.name,
|
||||||
|
active_workspace: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
return get_layer_surface(SctkLayerSurfaceSettings {
|
return get_layer_surface(SctkLayerSurfaceSettings {
|
||||||
|
|
@ -172,8 +173,19 @@ impl Application for App {
|
||||||
std::process::exit(0);
|
std::process::exit(0);
|
||||||
}
|
}
|
||||||
Msg::Closed(_) => {}
|
Msg::Closed(_) => {}
|
||||||
Msg::ActivateWorkspace(workspace) => {
|
Msg::ActivateWorkspace(workspace_handle) => {
|
||||||
// TODO
|
// XXX
|
||||||
|
for workspace in &self.workspaces {
|
||||||
|
if &workspace.handle == &workspace_handle {
|
||||||
|
for surface in self.layer_surfaces.values_mut() {
|
||||||
|
if &surface.output_name == &workspace.output_name {
|
||||||
|
surface.active_workspace = Some(workspace_handle);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -150,10 +150,7 @@ impl ToplevelInfoHandler for AppData {
|
||||||
toplevel: &zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
|
toplevel: &zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
|
||||||
) {
|
) {
|
||||||
let info = self.toplevel_info_state.info(&toplevel).unwrap();
|
let info = self.toplevel_info_state.info(&toplevel).unwrap();
|
||||||
self.send_event(Event::NewToplevel(
|
self.send_event(Event::NewToplevel(toplevel.clone(), info.clone()));
|
||||||
toplevel.clone(),
|
|
||||||
info.clone(),
|
|
||||||
));
|
|
||||||
|
|
||||||
let frame = self.screencopy_state.screencopy_manager.capture_toplevel(
|
let frame = self.screencopy_state.screencopy_manager.capture_toplevel(
|
||||||
toplevel,
|
toplevel,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue