Settle window animations when their workspace hides
This commit is contained in:
1 parent
a840db5946
commit
a597d09a7a
2 files changed
+21
-1
No files matched your search
@@ -1460,7 +1460,11 @@ impl Ferese {
|
|||||||
if visible.contains(id) {
|
if visible.contains(id) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
layout_changed |= space.element_location(window).is_some();
|
let was_mapped = space.element_location(window).is_some();
|
||||||
|
layout_changed |= was_mapped;
|
||||||
|
if was_mapped && let Some(geometry) = self.window_geometry.get_mut(id) {
|
||||||
|
geometry.settle_presentation();
|
||||||
|
}
|
||||||
space.unmap_elem(window);
|
space.unmap_elem(window);
|
||||||
}
|
}
|
||||||
self.space = space;
|
self.space = space;
|
||||||
|
|||||||
@@ -597,6 +597,22 @@ mod tests {
|
|||||||
assert!(!geometry.advance(Duration::from_millis(16), SpringConfig::default(), true));
|
assert!(!geometry.advance(Duration::from_millis(16), SpringConfig::default(), true));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn hiding_maximized_window_finishes_resize_without_hiding_decorations() {
|
||||||
|
let normal = Rect::new(100.0, 50.0, 900.0, 700.0);
|
||||||
|
let maximized = Rect::new(0.0, 40.0, 1920.0, 1040.0);
|
||||||
|
let mut geometry = WindowGeometry::new(normal, None);
|
||||||
|
geometry.set_presentation_mode(maximized, PresentationMode::Maximized, Duration::ZERO);
|
||||||
|
geometry.advance(Duration::from_millis(16), SpringConfig::default(), true);
|
||||||
|
assert!(geometry.is_zooming());
|
||||||
|
|
||||||
|
geometry.settle_presentation();
|
||||||
|
|
||||||
|
assert_eq!(geometry.visual.current, maximized);
|
||||||
|
assert_eq!(geometry.decorations, 1.0);
|
||||||
|
assert!(!geometry.is_zooming());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn maximized_zoom_keeps_decorations_and_restores_through_fullscreen() {
|
fn maximized_zoom_keeps_decorations_and_restores_through_fullscreen() {
|
||||||
let normal = Rect::new(800.0, 50.0, 600.0, 700.0);
|
let normal = Rect::new(800.0, 50.0, 600.0, 700.0);
|
||||||
|
|||||||
Reference in new issue
Block a user