mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-24 02:01:18 +07:00
tty: Disable dmabuf global before destroying
This commit is contained in:
+16
-2
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -202,9 +202,11 @@ impl DmabufHandler for State {
|
||||
dmabuf: Dmabuf,
|
||||
notifier: ImportNotifier,
|
||||
) {
|
||||
let renderer = self.backend.renderer().expect(
|
||||
"the dmabuf global must be created and destroyed together with the output device",
|
||||
);
|
||||
let Some(renderer) = self.backend.renderer() else {
|
||||
notifier.failed();
|
||||
return;
|
||||
};
|
||||
|
||||
match renderer.import_dmabuf(&dmabuf, None) {
|
||||
Ok(_texture) => {
|
||||
let _ = notifier.successful::<State>();
|
||||
|
||||
Reference in New Issue
Block a user