aboutsummaryrefslogtreecommitdiff
path: root/src/layout/monitor.rs
diff options
context:
space:
mode:
authorIvan Molodetskikh <yalterz@gmail.com>2025-04-25 16:54:33 +0300
committerIvan Molodetskikh <yalterz@gmail.com>2025-04-25 16:55:36 +0300
commitd2a1cf53b496a24457986061f4d2f9e22ab4cd7e (patch)
tree5c456912bdea41dba6b8daec6c07df7292ca8dc5 /src/layout/monitor.rs
parent62d47d77d5b75789e8b6b7ec318d604bb918b530 (diff)
downloadniri-d2a1cf53b496a24457986061f4d2f9e22ab4cd7e.tar.gz
niri-d2a1cf53b496a24457986061f4d2f9e22ab4cd7e.tar.bz2
niri-d2a1cf53b496a24457986061f4d2f9e22ab4cd7e.zip
Fix panic when interactively moving to invisible workspace
Introduced in the interactive move between workspaces commit.
Diffstat (limited to 'src/layout/monitor.rs')
-rw-r--r--src/layout/monitor.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layout/monitor.rs b/src/layout/monitor.rs
index ec37d749..67f3dc77 100644
--- a/src/layout/monitor.rs
+++ b/src/layout/monitor.rs
@@ -906,7 +906,7 @@ impl<W: LayoutElement> Monitor<W> {
.as_ref()
.and_then(|hint| hint.workspace.existing_id());
- for (ws, geo) in self.workspaces_with_render_geo_mut() {
+ for (ws, geo) in self.workspaces_with_render_geo_mut(true) {
ws.update_render_elements(is_active);
if Some(ws.id()) == insert_hint_ws_id {
@@ -1308,13 +1308,14 @@ impl<W: LayoutElement> Monitor<W> {
pub fn workspaces_with_render_geo_mut(
&mut self,
+ cull: bool,
) -> impl Iterator<Item = (&mut Workspace<W>, Rectangle<f64, Logical>)> {
let output_geo = Rectangle::from_size(self.view_size);
let geo = self.workspaces_render_geo();
zip(self.workspaces.iter_mut(), geo)
// Cull out workspaces outside the output.
- .filter(move |(_ws, geo)| geo.intersection(output_geo).is_some())
+ .filter(move |(_ws, geo)| !cull || geo.intersection(output_geo).is_some())
}
pub fn workspace_under(