shell: Add new sticky_layer
This commit is contained in:
parent
35766a372b
commit
cf21d2689a
1 changed files with 13 additions and 2 deletions
|
|
@ -227,7 +227,8 @@ pub struct WorkspaceSet {
|
||||||
tiling_enabled: bool,
|
tiling_enabled: bool,
|
||||||
output: Output,
|
output: Output,
|
||||||
theme: cosmic::Theme,
|
theme: cosmic::Theme,
|
||||||
pub(crate) workspaces: Vec<Workspace>,
|
pub sticky_layer: FloatingLayout,
|
||||||
|
pub workspaces: Vec<Workspace>,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_workspace(
|
fn create_workspace(
|
||||||
|
|
@ -339,6 +340,7 @@ impl WorkspaceSet {
|
||||||
})
|
})
|
||||||
.collect(),
|
.collect(),
|
||||||
};
|
};
|
||||||
|
let sticky_layer = FloatingLayout::new(theme.clone(), output);
|
||||||
|
|
||||||
WorkspaceSet {
|
WorkspaceSet {
|
||||||
previously_active: None,
|
previously_active: None,
|
||||||
|
|
@ -347,6 +349,7 @@ impl WorkspaceSet {
|
||||||
idx,
|
idx,
|
||||||
tiling_enabled,
|
tiling_enabled,
|
||||||
theme,
|
theme,
|
||||||
|
sticky_layer,
|
||||||
workspaces,
|
workspaces,
|
||||||
output: output.clone(),
|
output: output.clone(),
|
||||||
}
|
}
|
||||||
|
|
@ -380,6 +383,11 @@ impl WorkspaceSet {
|
||||||
new_output: &Output,
|
new_output: &Output,
|
||||||
toplevel_info: &mut ToplevelInfoState<State, CosmicSurface>,
|
toplevel_info: &mut ToplevelInfoState<State, CosmicSurface>,
|
||||||
) {
|
) {
|
||||||
|
self.sticky_layer.set_output(new_output);
|
||||||
|
for window in self.sticky_layer.windows() {
|
||||||
|
toplevel_info.toplevel_leave_output(&window, &self.output);
|
||||||
|
toplevel_info.toplevel_enter_output(&window, &new_output);
|
||||||
|
}
|
||||||
for workspace in &mut self.workspaces {
|
for workspace in &mut self.workspaces {
|
||||||
workspace.set_output(new_output, toplevel_info);
|
workspace.set_output(new_output, toplevel_info);
|
||||||
}
|
}
|
||||||
|
|
@ -394,6 +402,7 @@ impl WorkspaceSet {
|
||||||
} else {
|
} else {
|
||||||
self.workspaces[self.active].refresh(xdg_activation_state);
|
self.workspaces[self.active].refresh(xdg_activation_state);
|
||||||
}
|
}
|
||||||
|
self.sticky_layer.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_empty_workspace(&mut self, state: &mut WorkspaceUpdateGuard<State>) {
|
fn add_empty_workspace(&mut self, state: &mut WorkspaceUpdateGuard<State>) {
|
||||||
|
|
@ -519,7 +528,7 @@ impl WorkspaceSet {
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Workspaces {
|
pub struct Workspaces {
|
||||||
sets: IndexMap<Output, WorkspaceSet>,
|
pub sets: IndexMap<Output, WorkspaceSet>,
|
||||||
backup_set: Option<WorkspaceSet>,
|
backup_set: Option<WorkspaceSet>,
|
||||||
amount: WorkspaceAmount,
|
amount: WorkspaceAmount,
|
||||||
mode: WorkspaceMode,
|
mode: WorkspaceMode,
|
||||||
|
|
@ -994,6 +1003,8 @@ impl Workspaces {
|
||||||
pub fn set_theme(&mut self, theme: cosmic::Theme, xdg_activation_state: &XdgActivationState) {
|
pub fn set_theme(&mut self, theme: cosmic::Theme, xdg_activation_state: &XdgActivationState) {
|
||||||
for (_, s) in &mut self.sets {
|
for (_, s) in &mut self.sets {
|
||||||
s.theme = theme.clone();
|
s.theme = theme.clone();
|
||||||
|
s.sticky_layer.theme = theme.clone();
|
||||||
|
s.sticky_layer.refresh();
|
||||||
for mut w in &mut s.workspaces {
|
for mut w in &mut s.workspaces {
|
||||||
w.tiling_layer.theme = theme.clone();
|
w.tiling_layer.theme = theme.clone();
|
||||||
w.floating_layer.theme = theme.clone();
|
w.floating_layer.theme = theme.clone();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue