shell: Correctly handle window geometry

This commit is contained in:
Victoria Brekenfeld 2022-10-24 14:05:36 +02:00
parent 1eb5d1e64f
commit f59bb8a06e
3 changed files with 9 additions and 6 deletions

View file

@ -221,7 +221,7 @@ where
) -> Vec<C> {
AsRenderElements::<R>::render_elements::<CosmicWindowRenderElement<R>>(
&self.window,
location - self.window.geometry().loc.to_physical_precise_round(scale),
location,
scale,
)
.into_iter()

View file

@ -16,7 +16,7 @@ use crate::{
use id_tree::{InsertBehavior, MoveBehavior, Node, NodeId, NodeIdError, RemoveBehavior, Tree};
use smithay::{
backend::renderer::{element::AsRenderElements, ImportAll, Renderer},
desktop::{layer_map_for_output, Window},
desktop::{layer_map_for_output, space::SpaceElement, Window},
input::{
pointer::{Focus, GrabStartData as PointerGrabStartData},
Seat,
@ -899,7 +899,6 @@ impl TilingLayout {
<R as Renderer>::TextureId: 'static,
{
let output_scale = output.current_scale().fractional_scale();
let int_scale = output.current_scale().integer_scale();
if !self.trees.contains_key(output) {
return Err(OutputNotMapped);
@ -916,7 +915,11 @@ impl TilingLayout {
})
.flat_map(|(mapped, loc)| {
mapped.render_elements::<TilingRenderElement<R>>(
loc.to_physical(int_scale),
loc.to_physical_precise_round(output_scale)
- mapped
.geometry()
.loc
.to_physical_precise_round(output_scale),
Scale::from(output_scale),
)
})

View file

@ -128,10 +128,10 @@ impl Workspace {
.element_under(location)
.or_else(|| {
self.tiling_layer.mapped().find_map(|(_, mapped, loc)| {
let test_point = location - loc.to_f64();
let test_point = location - loc.to_f64() + mapped.geometry().loc.to_f64();
mapped
.is_in_input_region(&test_point)
.then_some((mapped, loc))
.then_some((mapped, loc - mapped.geometry().loc))
})
})
}