diff --git a/src/backend/render/mod.rs b/src/backend/render/mod.rs index 58793018..8ea52693 100644 --- a/src/backend/render/mod.rs +++ b/src/backend/render/mod.rs @@ -82,9 +82,7 @@ where Some(ptr) => ptr, None => continue, }; - let location = state - .shell - .map_global_to_space(pointer.current_location().to_i32_round(), output); + let location = pointer.current_location() - output.current_location().to_f64(); if mode != CursorMode::None { elements.extend( diff --git a/src/shell/layout/tiling/mod.rs b/src/shell/layout/tiling/mod.rs index b59e0cae..0ba18ad3 100644 --- a/src/shell/layout/tiling/mod.rs +++ b/src/shell/layout/tiling/mod.rs @@ -1251,14 +1251,28 @@ impl TilingLayout { } Ok(self - .mapped() - .flat_map(|(o, mapped, loc)| { - if o == output { - Some((mapped, loc)) - } else { - None + .trees + .iter() + .flat_map(|(output_data, tree)| { + if &output_data.output != output { + return None; } + let root = tree.root_node_id()?; + Some( + tree.traverse_pre_order(root) + .unwrap() + .filter(|node| node.data().is_mapped(None)) + .map(|node| match node.data() { + Data::Mapped { + mapped, + last_geometry, + .. + } => (mapped, last_geometry.loc), + _ => unreachable!(), + }), + ) }) + .flatten() .flat_map(|(mapped, loc)| { AsRenderElements::::render_elements::>( mapped, diff --git a/src/shell/mod.rs b/src/shell/mod.rs index b8dbb8f5..1bd005e1 100644 --- a/src/shell/mod.rs +++ b/src/shell/mod.rs @@ -903,20 +903,6 @@ impl Shell { } } - pub fn map_space_to_global( - &self, - space_loc: impl Into>, - output: &Output, - ) -> Point { - match self.workspaces { - WorkspaceMode::Global(_) => space_loc.into(), - WorkspaceMode::OutputBound(_, _) => { - let p = space_loc.into().to_f64() + output.current_location().to_f64(); - (C::from_f64(p.x), C::from_f64(p.y)).into() - } - } - } - pub fn refresh(&mut self) { self.popups.cleanup();