From b7ed2fb82a19afe73e3e51ef2331ac6ad9c175a0 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Sat, 23 Mar 2024 14:38:07 +0400 Subject: Add is-active window rule matcher --- src/layout/mod.rs | 4 ++-- src/layout/workspace.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/layout') 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); - fn set_activated(&self, active: bool); + fn set_activated(&mut self, active: bool); fn set_bounds(&self, bounds: Size); fn send_pending_configure(&self); @@ -1893,7 +1893,7 @@ mod tests { fn set_offscreen_element_id(&self, _id: Option) {} - fn set_activated(&self, _active: bool) {} + fn set_activated(&mut self, _active: bool) {} fn set_bounds(&self, _bounds: Size) {} 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 Workspace { 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; -- cgit