fix: apply activated state when updating maximized layout

This commit is contained in:
Ashley Wulber 2024-05-30 15:21:49 -04:00 committed by Michael Murphy
parent 743b5ad4a7
commit 13e67f3dc2

View file

@ -1173,10 +1173,10 @@ impl FloatingLayout {
} }
// update maximized elements // update maximized elements
let update = self let update: Vec<_> = self
.space .space
.elements() .elements()
.find(|e| e.is_maximized(false)) .filter(|e| e.is_maximized(true))
.map(|mapped| { .map(|mapped| {
let output = self.space.outputs().next().unwrap().clone(); let output = self.space.outputs().next().unwrap().clone();
let layers = layer_map_for_output(&output); let layers = layer_map_for_output(&output);
@ -1186,10 +1186,13 @@ impl FloatingLayout {
mapped.set_geometry(geometry.to_global(&output)); mapped.set_geometry(geometry.to_global(&output));
mapped.configure(); mapped.configure();
(mapped.clone(), geometry.loc) (mapped.clone(), geometry.loc, mapped.is_activated(true))
}); })
if let Some((mapped, position)) = update { .collect();
self.space.map_element(mapped, position.as_logical(), true);
for (mapped, position, is_activated) in update {
self.space
.map_element(mapped, position.as_logical(), is_activated);
} }
} }