shell: Fix render positions for global workspace mode
This commit is contained in:
parent
c25f2ed447
commit
4a9afd0572
3 changed files with 21 additions and 23 deletions
|
|
@ -82,9 +82,7 @@ where
|
||||||
Some(ptr) => ptr,
|
Some(ptr) => ptr,
|
||||||
None => continue,
|
None => continue,
|
||||||
};
|
};
|
||||||
let location = state
|
let location = pointer.current_location() - output.current_location().to_f64();
|
||||||
.shell
|
|
||||||
.map_global_to_space(pointer.current_location().to_i32_round(), output);
|
|
||||||
|
|
||||||
if mode != CursorMode::None {
|
if mode != CursorMode::None {
|
||||||
elements.extend(
|
elements.extend(
|
||||||
|
|
|
||||||
|
|
@ -1251,14 +1251,28 @@ impl TilingLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(self
|
Ok(self
|
||||||
.mapped()
|
.trees
|
||||||
.flat_map(|(o, mapped, loc)| {
|
.iter()
|
||||||
if o == output {
|
.flat_map(|(output_data, tree)| {
|
||||||
Some((mapped, loc))
|
if &output_data.output != output {
|
||||||
} else {
|
return None;
|
||||||
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)| {
|
.flat_map(|(mapped, loc)| {
|
||||||
AsRenderElements::<R>::render_elements::<CosmicMappedRenderElement<R>>(
|
AsRenderElements::<R>::render_elements::<CosmicMappedRenderElement<R>>(
|
||||||
mapped,
|
mapped,
|
||||||
|
|
|
||||||
|
|
@ -903,20 +903,6 @@ impl Shell {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn map_space_to_global<C: smithay::utils::Coordinate>(
|
|
||||||
&self,
|
|
||||||
space_loc: impl Into<Point<C, Logical>>,
|
|
||||||
output: &Output,
|
|
||||||
) -> Point<C, Logical> {
|
|
||||||
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) {
|
pub fn refresh(&mut self) {
|
||||||
self.popups.cleanup();
|
self.popups.cleanup();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue