fix: clear sticky windows, or floating windows focus hint if focus moves
This commit is contained in:
parent
0fbd4574ef
commit
6645edff64
4 changed files with 40 additions and 10 deletions
|
|
@ -430,6 +430,10 @@ impl CosmicMapped {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn is_sticky(&self) -> bool {
|
||||||
|
self.active_window().is_sticky()
|
||||||
|
}
|
||||||
|
|
||||||
pub fn pending_size(&self) -> Option<Size<i32, Logical>> {
|
pub fn pending_size(&self) -> Option<Size<i32, Logical>> {
|
||||||
match &self.element {
|
match &self.element {
|
||||||
CosmicMappedInternal::Stack(s) => s.pending_size(),
|
CosmicMappedInternal::Stack(s) => s.pending_size(),
|
||||||
|
|
|
||||||
|
|
@ -255,8 +255,17 @@ impl Shell {
|
||||||
let workspace = if let Some(workspace) = workspace {
|
let workspace = if let Some(workspace) = workspace {
|
||||||
self.workspaces.space_for_handle_mut(&workspace.0).unwrap()
|
self.workspaces.space_for_handle_mut(&workspace.0).unwrap()
|
||||||
} else {
|
} else {
|
||||||
//should this be the active output or the focused output?
|
let output = match &target {
|
||||||
self.active_space_mut(&seat.focused_or_active_output())
|
FocusTarget::Window(mapped) => self
|
||||||
|
.workspaces
|
||||||
|
.sets
|
||||||
|
.iter()
|
||||||
|
.find(|(_, set)| set.sticky_layer.mapped().any(|m| m == mapped))
|
||||||
|
.map(|(output, _)| output.clone()),
|
||||||
|
FocusTarget::Fullscreen(_) => None,
|
||||||
|
};
|
||||||
|
|
||||||
|
self.active_space_mut(&output.unwrap_or_else(|| seat.active_output()))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -516,6 +516,12 @@ impl WorkspaceSet {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn refresh_focus_stacks(&mut self) {
|
||||||
|
for workspace in &mut self.workspaces {
|
||||||
|
workspace.refresh_focus_stack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fn activate(
|
fn activate(
|
||||||
&mut self,
|
&mut self,
|
||||||
idx: usize,
|
idx: usize,
|
||||||
|
|
@ -620,6 +626,7 @@ impl WorkspaceSet {
|
||||||
self.workspaces[self.active].refresh();
|
self.workspaces[self.active].refresh();
|
||||||
}
|
}
|
||||||
self.sticky_layer.refresh();
|
self.sticky_layer.refresh();
|
||||||
|
self.refresh_focus_stacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn add_empty_workspace(&mut self, state: &mut WorkspaceUpdateGuard<State>) {
|
fn add_empty_workspace(&mut self, state: &mut WorkspaceUpdateGuard<State>) {
|
||||||
|
|
|
||||||
|
|
@ -526,10 +526,16 @@ impl Workspace {
|
||||||
.mapped()
|
.mapped()
|
||||||
.chain(self.tiling_layer.mapped().map(|(w, _)| w))
|
.chain(self.tiling_layer.mapped().map(|(w, _)| w))
|
||||||
.chain(move_mapped.iter())
|
.chain(move_mapped.iter())
|
||||||
|
.chain(
|
||||||
|
self.minimized_windows
|
||||||
|
.iter()
|
||||||
|
.flat_map(MinimizedWindow::mapped),
|
||||||
|
)
|
||||||
};
|
};
|
||||||
stack.retain(|w| match w {
|
stack.retain(|w| match w {
|
||||||
FocusTarget::Fullscreen(s) => fullscreen_surfaces.contains(&s),
|
FocusTarget::Fullscreen(s) => fullscreen_surfaces.contains(&s),
|
||||||
FocusTarget::Window(w) => mapped().any(|m| w == m),
|
// Sticky windows live in the `WorkspaceSet` but are shown on whichever workspace is current
|
||||||
|
FocusTarget::Window(w) => w.is_sticky() || mapped().any(|m| w == m),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1767,13 +1773,17 @@ impl Workspace {
|
||||||
|
|
||||||
self.floating_layer.render(
|
self.floating_layer.render(
|
||||||
renderer,
|
renderer,
|
||||||
|
render_focus
|
||||||
|
.then(|| {
|
||||||
focused.as_ref().and_then(|target| {
|
focused.as_ref().and_then(|target| {
|
||||||
if let FocusTarget::Window(mapped) = target {
|
if let FocusTarget::Window(mapped) = target {
|
||||||
Some(mapped)
|
Some(mapped)
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}),
|
})
|
||||||
|
})
|
||||||
|
.flatten(),
|
||||||
resize_indicator.clone(),
|
resize_indicator.clone(),
|
||||||
indicator_thickness,
|
indicator_thickness,
|
||||||
alpha,
|
alpha,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue