diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-01 22:43:21 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-12-01 22:24:21 -0800 |
| commit | 1e76716819ecda33dca0e612d62a8f6c2892890d (patch) | |
| tree | df5406e4aec18e2cfdcc0530dc290402ab9026af /src | |
| parent | 91a42fdf58528f20615d83e85739835785da9506 (diff) | |
| download | niri-1e76716819ecda33dca0e612d62a8f6c2892890d.tar.gz niri-1e76716819ecda33dca0e612d62a8f6c2892890d.tar.bz2 niri-1e76716819ecda33dca0e612d62a8f6c2892890d.zip | |
layout: Add a test for windows on other workspace remaining activated
Diffstat (limited to 'src')
| -rw-r--r-- | src/layout/mod.rs | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index cb4bd6f2..6cb4dd44 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -3840,6 +3840,7 @@ mod tests { min_size: Size<i32, Logical>, max_size: Size<i32, Logical>, pending_fullscreen: Cell<bool>, + pending_activated: Cell<bool>, } #[derive(Debug, Clone)] @@ -3860,6 +3861,7 @@ mod tests { min_size, max_size, pending_fullscreen: Cell::new(false), + pending_activated: Cell::new(false), })) } @@ -3954,7 +3956,9 @@ mod tests { fn set_offscreen_element_id(&self, _id: Option<Id>) {} - fn set_activated(&mut self, _active: bool) {} + fn set_activated(&mut self, active: bool) { + self.0.pending_activated.set(active); + } fn set_bounds(&self, _bounds: Size<i32, Logical>) {} @@ -6361,6 +6365,24 @@ mod tests { check_ops(&ops); } + #[test] + fn windows_on_other_workspaces_remain_activated() { + let ops = [ + Op::AddOutput(3), + Op::AddWindow { + id: 3, + bbox: Rectangle::from_loc_and_size((0, 0), (100, 200)), + min_max_size: Default::default(), + }, + Op::FocusWorkspaceDown, + Op::Refresh { is_active: true }, + ]; + + let layout = check_ops(&ops); + let (_, win) = layout.windows().next().unwrap(); + assert!(win.0.pending_activated.get()); + } + fn arbitrary_spacing() -> impl Strategy<Value = f64> { // Give equal weight to: // - 0: the element is disabled |
