diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-23 14:38:07 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-03-23 15:45:44 +0400 |
| commit | b7ed2fb82a19afe73e3e51ef2331ac6ad9c175a0 (patch) | |
| tree | 8757c39889958bd6a8f87ac9089d8e5a7fd43a76 /src/layout | |
| parent | f3f02aca2058dd7adc4d75707ded2b5d8887a258 (diff) | |
| download | niri-b7ed2fb82a19afe73e3e51ef2331ac6ad9c175a0.tar.gz niri-b7ed2fb82a19afe73e3e51ef2331ac6ad9c175a0.tar.bz2 niri-b7ed2fb82a19afe73e3e51ef2331ac6ad9c175a0.zip | |
Add is-active window rule matcher
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/mod.rs | 4 | ||||
| -rw-r--r-- | src/layout/workspace.rs | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 7162c3e3..bc5c8dcf 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -107,7 +107,7 @@ pub trait LayoutElement { fn output_enter(&self, output: &Output); fn output_leave(&self, output: &Output); fn set_offscreen_element_id(&self, id: Option<Id>); - fn set_activated(&self, active: bool); + fn set_activated(&mut self, active: bool); fn set_bounds(&self, bounds: Size<i32, Logical>); fn send_pending_configure(&self); @@ -1893,7 +1893,7 @@ mod tests { fn set_offscreen_element_id(&self, _id: Option<Id>) {} - fn set_activated(&self, _active: bool) {} + fn set_activated(&mut self, _active: bool) {} fn set_bounds(&self, _bounds: Size<i32, Logical>) {} diff --git a/src/layout/workspace.rs b/src/layout/workspace.rs index 03868dc0..64be3bcc 100644 --- a/src/layout/workspace.rs +++ b/src/layout/workspace.rs @@ -1550,12 +1550,12 @@ impl<W: LayoutElement> Workspace<W> { true } - pub fn refresh(&self, is_active: bool) { + pub fn refresh(&mut self, is_active: bool) { let bounds = self.toplevel_bounds(); - for (col_idx, col) in self.columns.iter().enumerate() { - for (tile_idx, tile) in col.tiles.iter().enumerate() { - let win = tile.window(); + for (col_idx, col) in self.columns.iter_mut().enumerate() { + for (tile_idx, tile) in col.tiles.iter_mut().enumerate() { + let win = tile.window_mut(); let active = is_active && self.active_column_idx == col_idx && col.active_tile_idx == tile_idx; |
