📦📎-fixes, typo fixes

This commit is contained in:
Aleksander
2025-09-20 12:17:17 +02:00
parent cfb733de09
commit b9e5541971
41 changed files with 494 additions and 498 deletions

View File

@@ -10,9 +10,9 @@ use smithay_client_toolkit::reexports::protocols_wlr::export_dmabuf::v1::client:
use wayland_client::{Connection, QueueHandle, Dispatch, Proxy};
use crate::{
WlxCapture,
frame::{DmabufFrame, DrmFormat, FramePlane, WlxFrame},
wayland::WlxClient,
WlxCapture,
};
use log::{debug, warn};
@@ -84,20 +84,20 @@ where
true
}
fn receive(&mut self) -> Option<R> {
if let Some(data) = self.data.as_ref() {
if let Some(WlxFrame::Dmabuf(last)) = data.receiver.try_iter().last() {
// this is the only protocol that requires us to manually close the FD
while self.fds.len() > 6 * last.num_planes {
// safe unwrap
let _ = unsafe { OwnedFd::from_raw_fd(self.fds.pop_back().unwrap()) };
}
for p in 0..last.num_planes {
if let Some(fd) = last.planes[p].fd {
self.fds.push_front(fd);
}
}
return (data.receive_callback)(&data.user_data, WlxFrame::Dmabuf(last));
if let Some(data) = self.data.as_ref()
&& let Some(WlxFrame::Dmabuf(last)) = data.receiver.try_iter().last()
{
// this is the only protocol that requires us to manually close the FD
while self.fds.len() > 6 * last.num_planes {
// safe unwrap
let _ = unsafe { OwnedFd::from_raw_fd(self.fds.pop_back().unwrap()) };
}
for p in 0..last.num_planes {
if let Some(fd) = last.planes[p].fd {
self.fds.push_front(fd);
}
}
return (data.receive_callback)(&data.user_data, WlxFrame::Dmabuf(last));
}
None
}