From 9acbea138979fa0e311343fc1510e3d668955f57 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Wed, 17 Apr 2024 21:49:31 +0200 Subject: [PATCH 1/3] metal: discard presentation feedback when presentation fails --- src/backends/metal/video.rs | 11 +++++++---- src/renderer.rs | 7 +++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/backends/metal/video.rs b/src/backends/metal/video.rs index 4a598416..9d17d04c 100644 --- a/src/backends/metal/video.rs +++ b/src/backends/metal/video.rs @@ -765,6 +765,9 @@ impl MetalConnector { if let Err(e) = changes.commit(DRM_MODE_ATOMIC_NONBLOCK | DRM_MODE_PAGE_FLIP_EVENT, 0) { if let DrmError::Atomic(OsError(c::EACCES)) = e { log::debug!("Could not perform atomic commit, likely because we're no longer the DRM master"); + self.render_result + .borrow_mut() + .discard_presentation_feedback(); return Ok(()); } if let Some(fb) = &new_fb { @@ -784,6 +787,9 @@ impl MetalConnector { } } } + self.render_result + .borrow_mut() + .discard_presentation_feedback(); Err(MetalError::Commit(e)) } else { if let Some(fb) = new_fb { @@ -1792,10 +1798,7 @@ impl MetalBackend { let _ = fb.client.remove_obj(&*fb); } } else { - for fb in rr.presentation_feedbacks.drain(..) { - fb.send_discarded(); - let _ = fb.client.remove_obj(&*fb); - } + rr.discard_presentation_feedback(); } } } diff --git a/src/renderer.rs b/src/renderer.rs index 4f23949c..502c817e 100644 --- a/src/renderer.rs +++ b/src/renderer.rs @@ -42,6 +42,13 @@ impl RenderResult { let _ = fr.client.remove_obj(&*fr); } } + + pub fn discard_presentation_feedback(&mut self) { + for fb in self.presentation_feedbacks.drain(..) { + fb.send_discarded(); + let _ = fb.client.remove_obj(&*fb); + } + } } impl Debug for RenderResult { From cc58d069e09f0272134c4341b4dfd5f5d9ebe15b Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Wed, 17 Apr 2024 21:50:37 +0200 Subject: [PATCH 2/3] surface: ignore set_visible for sub-surfaces without buffers --- src/ifs/wl_surface.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifs/wl_surface.rs b/src/ifs/wl_surface.rs index 63f12004..3d2233b0 100644 --- a/src/ifs/wl_surface.rs +++ b/src/ifs/wl_surface.rs @@ -1215,7 +1215,9 @@ impl WlSurface { let children = self.children.borrow_mut(); if let Some(children) = children.deref() { for child in children.subsurfaces.values() { - child.surface.set_visible(visible); + if child.surface.buffer.is_some() { + child.surface.set_visible(visible); + } } } if !visible { From 57bd05049f0cee2424c55e4c90f6317cdded3b68 Mon Sep 17 00:00:00 2001 From: Julian Orth Date: Wed, 17 Apr 2024 21:51:49 +0200 Subject: [PATCH 3/3] docs: update release notes --- release-notes.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/release-notes.md b/release-notes.md index c4b37960..08ef449a 100644 --- a/release-notes.md +++ b/release-notes.md @@ -5,6 +5,8 @@ - Add support for virtual-keyboard-unstable-v1. - Add support for zwp_input_method_manager_v2. - Add support for zwp_text_input_manager_v3. +- Add support for push-to-talk. +- Various bugfixes. # 1.0.3 (2024-04-11)