diff options
author | tcmal <me@aria.rip> | 2024-08-13 22:27:16 +0100 |
---|---|---|
committer | tcmal <me@aria.rip> | 2024-08-14 17:45:21 +0100 |
commit | 6fd934872a3c9f868bed5bd2f5ee33f0cb748912 (patch) | |
tree | 13f844d164ac7ffe44484ad24bed50ef6393b776 /src/clients/tile.rs | |
parent | f9d5af7f060ada6f224861967e31bb74a0d24e18 (diff) |
Move to one list of clients, shared across monitors
Diffstat (limited to 'src/clients/tile.rs')
-rw-r--r-- | src/clients/tile.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/clients/tile.rs b/src/clients/tile.rs index e089c3f..f1f00a7 100644 --- a/src/clients/tile.rs +++ b/src/clients/tile.rs @@ -4,7 +4,7 @@ use std::cmp::min; use crate::conn_info::Connection; -use super::{MonitorGeometry, MonitorInfo}; +use super::{Client, MonitorGeometry, MonitorInfo}; /// A simple tiling function #[allow( @@ -13,12 +13,12 @@ use super::{MonitorGeometry, MonitorInfo}; clippy::cast_possible_truncation, clippy::cast_lossless )] -pub fn tile(mon: &mut MonitorInfo, conn: &Connection<'_>) { - if mon.clients.is_empty() { +pub fn tile(conn: &Connection<'_>, clients: &mut [Client], mon: &MonitorInfo) { + if clients.is_empty() { return; } - let n = mon.clients_tiled_mut().count(); + let n = mon.iter_visible_tiling(&mut *clients).count(); let nmaster = 1; let mfact = 0.6; @@ -38,7 +38,7 @@ pub fn tile(mon: &mut MonitorInfo, conn: &Connection<'_>) { }; let (mut main_y, mut second_y) = (0, 0); - for (i, c) in mon.clients_tiled_mut().enumerate() { + for (i, c) in mon.iter_visible_tiling(clients).enumerate() { if i < nmaster { let h = (mon_height - main_y) / (min(nmaster, n) - i) as u16; c.set_geom( |