aboutsummaryrefslogtreecommitdiff
path: root/src/layout/mod.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/mod.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/mod.rs')
-rw-r--r--src/layout/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layout/mod.rs b/src/layout/mod.rs
index 42ae58c5..c9ddfbaa 100644
--- a/src/layout/mod.rs
+++ b/src/layout/mod.rs
@@ -4444,7 +4444,8 @@ impl<W: LayoutElement> Layout<W> {
let mon = &mut monitors[*active_monitor_idx];
let zoom = mon.overview_zoom();
// No point in trying to use the pointer position on the wrong output.
- let (ws, ws_geo) = mon.workspaces_with_render_geo().next().unwrap();
+ let ws = &mon.workspaces[0];
+ let ws_geo = mon.workspaces_render_geo().next().unwrap();
let position = if move_.is_floating {
InsertPosition::Floating
@@ -4552,7 +4553,7 @@ impl<W: LayoutElement> Layout<W> {
// needed because empty_workspace_above_first could have modified the idx
let (tile, tile_render_loc, ws_geo) = mon
- .workspaces_with_render_geo_mut()
+ .workspaces_with_render_geo_mut(false)
.find_map(|(ws, geo)| {
ws.tiles_with_render_positions_mut(false)
.find(|(tile, _)| tile.window().id() == &win_id)