Destroy zxdg_toplevel_decoration_v1 object with toplevel

This is a protocol violation and crashes dwl.
On niri it causes the toplevel to "leak".
This commit is contained in:
bbb651 2025-03-30 14:26:04 +03:00 committed by Shawn Wallace
parent 0559ace758
commit 45c0556964

View file

@ -216,7 +216,10 @@ impl SurfaceData {
fn destroy_role(&mut self) {
if let Some(role) = self.role.take() {
match role {
SurfaceRole::Toplevel(Some(t)) => {
SurfaceRole::Toplevel(Some(mut t)) => {
if let Some(decoration) = t.decoration.take() {
decoration.destroy();
}
t.toplevel.destroy();
t.xdg.surface.destroy();
}