From e259061cbcfaf3a52a9eb2016b949cdc42e45db3 Mon Sep 17 00:00:00 2001 From: Ivan Molodetskikh Date: Tue, 19 Dec 2023 20:56:00 +0400 Subject: Implement popup unconstraining Using my new Smithay implementation. --- src/layout.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/layout.rs') diff --git a/src/layout.rs b/src/layout.rs index 86cc7d70..b53529f5 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -795,6 +795,33 @@ impl Layout { None } + pub fn window_y(&self, window: &W) -> Option { + match &self.monitor_set { + MonitorSet::Normal { monitors, .. } => { + for mon in monitors { + for ws in &mon.workspaces { + for col in &ws.columns { + if let Some(idx) = col.windows.iter().position(|w| w == window) { + return Some(col.window_y(idx)); + } + } + } + } + } + MonitorSet::NoOutputs { workspaces, .. } => { + for ws in workspaces { + for col in &ws.columns { + if let Some(idx) = col.windows.iter().position(|w| w == window) { + return Some(col.window_y(idx)); + } + } + } + } + } + + None + } + pub fn update_output_size(&mut self, output: &Output) { let MonitorSet::Normal { monitors, .. } = &mut self.monitor_set else { panic!() -- cgit