diff --git a/src/layer/mapped.rs b/src/layer/mapped.rs index 13f657cf..6f871340 100644 --- a/src/layer/mapped.rs +++ b/src/layer/mapped.rs @@ -224,26 +224,22 @@ impl MappedLayer { location: Point, push: &mut dyn FnMut(LayerSurfaceRenderElement), ) { - let scale = Scale::from(self.scale); - let alpha = self.rules.opacity.unwrap_or(1.).clamp(0., 1.); - let location = location + self.bob_offset(); - if ctx.target.should_block_out(self.rules.block_out_from) { return; } - // Layer surfaces don't have extra geometry like windows. - let buf_pos = location; + let scale = Scale::from(self.scale); + let alpha = self.rules.opacity.unwrap_or(1.).clamp(0., 1.); + let location = location + self.bob_offset(); let surface = self.surface.wl_surface(); - for (popup, popup_offset) in PopupManager::popups_for_surface(surface) { - // Layer surfaces don't have extra geometry like windows. - let offset = popup_offset - popup.geometry().loc; + for (popup, offset) in PopupManager::popups_for_surface(surface) { + let surface_loc = location + (offset - popup.geometry().loc).to_f64(); push_elements_from_surface_tree( ctx.renderer, popup.wl_surface(), - (buf_pos + offset.to_f64()).to_physical_precise_round(scale), + surface_loc.to_physical_precise_round(scale), scale, alpha, Kind::ScanoutCandidate, diff --git a/src/window/mapped.rs b/src/window/mapped.rs index 4fefe61f..f01a0ce4 100644 --- a/src/window/mapped.rs +++ b/src/window/mapped.rs @@ -655,20 +655,18 @@ impl LayoutElement for Mapped { return; } - let buf_pos = location - self.window.geometry().loc.to_f64(); let surface = self.toplevel().wl_surface(); - let mut push = |elem: WaylandSurfaceRenderElement| push(elem.into()); - for (popup, popup_offset) in PopupManager::popups_for_surface(surface) { - let offset = self.window.geometry().loc + popup_offset - popup.geometry().loc; + for (popup, offset) in PopupManager::popups_for_surface(surface) { + let surface_loc = location + (offset - popup.geometry().loc).to_f64(); push_elements_from_surface_tree( ctx.renderer, popup.wl_surface(), - (buf_pos + offset.to_f64()).to_physical_precise_round(scale), + surface_loc.to_physical_precise_round(scale), scale, alpha, Kind::ScanoutCandidate, - &mut push, + &mut |elem| push(elem.into()), ); } }