1
0
Fork 0
forked from wry/wry

layer-shell: consider sub-surface extents during positioning

This commit is contained in:
Julian Orth 2024-05-08 13:04:19 +02:00
parent 06ac1189d0
commit a5d6b0f265
3 changed files with 18 additions and 25 deletions

View file

@ -103,12 +103,8 @@ impl Renderer<'_> {
macro_rules! render_layer {
($layer:expr) => {
for ls in $layer.iter() {
let pos = ls.position();
self.render_layer_surface(
ls.deref(),
x + pos.x1() - opos.x1(),
y + pos.y1() - opos.y1(),
);
let pos = ls.output_extents();
self.render_layer_surface(ls.deref(), x + pos.x1(), y + pos.y1());
self.base.ops.push(GfxApiOpt::Sync);
}
};
@ -539,8 +535,7 @@ impl Renderer<'_> {
}
pub fn render_layer_surface(&mut self, surface: &ZwlrLayerSurfaceV1, x: i32, y: i32) {
let body = surface.position().at_point(x, y);
let body = self.base.scale_rect(body);
self.render_surface(&surface.surface, x, y, Some(&body));
let (dx, dy) = surface.surface.extents.get().position();
self.render_surface(&surface.surface, x - dx, y - dy, None);
}
}