1
0
Fork 0
forked from wry/wry

sub-surface: update sub-surface positions if parent does not move

This commit is contained in:
Julian Orth 2024-07-10 20:23:30 +02:00
parent a9bba47449
commit 5a53b74265

View file

@ -138,6 +138,9 @@ impl WlSubsurface {
if let Some((x, y)) = pending.position.take() {
self.position
.set(self.surface.buffer_abs_pos.get().at_point(x, y));
let (parent_x, parent_y) = self.parent.buffer_abs_pos.get().position();
self.surface
.set_absolute_position(parent_x + x, parent_y + y);
self.parent.need_extents_update.set(true);
}
Ok(())
@ -172,6 +175,8 @@ impl WlSubsurface {
self.surface.set_toplevel(self.parent.toplevel.get());
self.surface.ext.set(self.clone());
update_children_attach(self)?;
let (x, y) = self.parent.buffer_abs_pos.get().position();
self.surface.set_absolute_position(x, y);
Ok(())
}