tty: Disable dmabuf global before destroying

This commit is contained in:
Ivan Molodetskikh
2024-01-01 09:57:51 +04:00
parent 84befb4e91
commit ac6ff7ff41
2 changed files with 21 additions and 5 deletions
+16 -2
View File
@@ -402,10 +402,24 @@ impl Tty {
}
let mut device = self.output_device.take().unwrap();
niri.dmabuf_state
.destroy_global::<State>(&niri.display_handle, self.dmabuf_global.take().unwrap());
device.gles.unbind_wl_display();
let global = self.dmabuf_global.take().unwrap();
niri.dmabuf_state
.disable_global::<State>(&niri.display_handle, &global);
niri.event_loop
.insert_source(
Timer::from_duration(Duration::from_secs(10)),
move |_, _, state| {
state
.niri
.dmabuf_state
.destroy_global::<State>(&state.niri.display_handle, global);
TimeoutAction::Drop
},
)
.unwrap();
niri.event_loop.remove(device.token);
}