chore: Formatting updates
This commit is contained in:
parent
ac889f609d
commit
4ee2763139
9 changed files with 170 additions and 80 deletions
|
|
@ -199,7 +199,9 @@ impl CosmicMapped {
|
|||
|
||||
pub fn has_surface(&self, surface: &WlSurface, surface_type: WindowSurfaceType) -> bool {
|
||||
self.windows().any(|(w, _)| {
|
||||
let Some(toplevel ) = w.wl_surface() else { return false };
|
||||
let Some(toplevel) = w.wl_surface() else {
|
||||
return false;
|
||||
};
|
||||
|
||||
if surface_type.contains(WindowSurfaceType::TOPLEVEL) {
|
||||
if toplevel == *surface {
|
||||
|
|
|
|||
|
|
@ -193,7 +193,9 @@ impl CosmicStack {
|
|||
return;
|
||||
}
|
||||
|
||||
let Some(idx) = windows.iter().position(|w| w == window) else { return };
|
||||
let Some(idx) = windows.iter().position(|w| w == window) else {
|
||||
return;
|
||||
};
|
||||
let window = windows.remove(idx);
|
||||
window.try_force_undecorated(false);
|
||||
window.set_tiled(false);
|
||||
|
|
@ -619,13 +621,7 @@ impl Program for CosmicStackInternal {
|
|||
|
||||
fn view(&self) -> CosmicElement<'_, Self::Message> {
|
||||
let windows = self.windows.lock().unwrap();
|
||||
let Some(width) = self
|
||||
.geometry
|
||||
.lock()
|
||||
.unwrap()
|
||||
.as_ref()
|
||||
.map(|r| r.size.w)
|
||||
else {
|
||||
let Some(width) = self.geometry.lock().unwrap().as_ref().map(|r| r.size.w) else {
|
||||
return iced_widget::row(Vec::new()).into();
|
||||
};
|
||||
let active = self.active.load(Ordering::SeqCst);
|
||||
|
|
|
|||
|
|
@ -722,13 +722,24 @@ where
|
|||
let changes = if unknown_keys {
|
||||
Some(Difference::NewOrRemoved)
|
||||
} else {
|
||||
current_state.iter().filter_map(|(a_id, a_bounds)| {
|
||||
let Some(b_bounds) = last_state.get(a_id) else { return Some(Difference::Movement) };
|
||||
(a_bounds != b_bounds).then(|| if a_bounds.position() != b_bounds.position() { Difference::Movement } else { Difference::Focus })
|
||||
}).fold(None, |a, b| match (a, b) {
|
||||
(None | Some(Difference::Movement), x) => Some(x),
|
||||
(a, _) => a,
|
||||
})
|
||||
current_state
|
||||
.iter()
|
||||
.filter_map(|(a_id, a_bounds)| {
|
||||
let Some(b_bounds) = last_state.get(a_id) else {
|
||||
return Some(Difference::Movement);
|
||||
};
|
||||
(a_bounds != b_bounds).then(|| {
|
||||
if a_bounds.position() != b_bounds.position() {
|
||||
Difference::Movement
|
||||
} else {
|
||||
Difference::Focus
|
||||
}
|
||||
})
|
||||
})
|
||||
.fold(None, |a, b| match (a, b) {
|
||||
(None | Some(Difference::Movement), x) => Some(x),
|
||||
(a, _) => a,
|
||||
})
|
||||
};
|
||||
|
||||
if unknown_keys || changes.is_some() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue