diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-14 15:00:11 +0400 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2024-05-14 15:35:43 +0400 |
| commit | 5f402210510aff0051abd080d664581c26e77c2b (patch) | |
| tree | f75918a6a30295b4f571846d09cc12ee75397f12 /src/layout/mod.rs | |
| parent | b14405904a8309fdcebc938f59584832ffe27fd6 (diff) | |
| download | niri-5f402210510aff0051abd080d664581c26e77c2b.tar.gz niri-5f402210510aff0051abd080d664581c26e77c2b.tar.bz2 niri-5f402210510aff0051abd080d664581c26e77c2b.zip | |
Refactor column and tile offsets, fix a few issues
Diffstat (limited to 'src/layout/mod.rs')
| -rw-r--r-- | src/layout/mod.rs | 31 |
1 files changed, 3 insertions, 28 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs index 1442dfd0..88b9b3ec 100644 --- a/src/layout/mod.rs +++ b/src/layout/mod.rs @@ -745,14 +745,14 @@ impl<W: LayoutElement> Layout<W> { None } - pub fn window_y(&self, window: &W::Id) -> Option<i32> { + pub fn window_loc(&self, window: &W::Id) -> Option<Point<i32, Logical>> { 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.position(window) { - return Some(col.window_y(idx)); + return Some(col.window_loc(idx)); } } } @@ -762,7 +762,7 @@ impl<W: LayoutElement> Layout<W> { for ws in workspaces { for col in &ws.columns { if let Some(idx) = col.position(window) { - return Some(col.window_y(idx)); + return Some(col.window_loc(idx)); } } } @@ -1995,31 +1995,6 @@ impl<W: LayoutElement> Layout<W> { } } - pub fn prepare_for_resize_animation(&mut self, window: &W::Id) { - let _span = tracy_client::span!("Layout::prepare_for_resize_animation"); - - match &mut self.monitor_set { - MonitorSet::Normal { monitors, .. } => { - for mon in monitors { - for ws in &mut mon.workspaces { - if ws.has_window(window) { - ws.prepare_for_resize_animation(window); - return; - } - } - } - } - MonitorSet::NoOutputs { workspaces, .. } => { - for ws in workspaces { - if ws.has_window(window) { - ws.prepare_for_resize_animation(window); - return; - } - } - } - } - } - pub fn refresh(&mut self) { let _span = tracy_client::span!("Layout::refresh"); |
