screencopy: Fix copying to opaque shm formats

This commit is contained in:
Victoria Brekenfeld 2023-12-12 21:28:27 +00:00 committed by Victoria Brekenfeld
parent cf9ae91e96
commit 35766a372b

View file

@ -12,7 +12,7 @@ use cosmic_protocols::screencopy::v1::server::zcosmic_screencopy_session_v1::{
};
use smithay::{
backend::{
allocator::dmabuf::Dmabuf,
allocator::{dmabuf::Dmabuf, format::get_transparent},
drm::DrmNode,
egl::EGLDevice,
renderer::{
@ -565,6 +565,7 @@ where
// ensure consistency, the SHM handler of smithay should ensure this
assert!((offset + (height - 1) * stride + width * pixelsize) as usize <= len);
let format = get_transparent(format).unwrap_or(format);
let mapping = renderer
.copy_framebuffer(Rectangle::from_loc_and_size((0, 0), buffer_size), format)?;
let gl_data = renderer.map_texture(&mapping)?;