Add CaptureImage type

This commit is contained in:
Ian Douglas Scott 2023-11-16 19:38:42 -08:00
parent f5045286a9
commit 0c19ea7167
4 changed files with 24 additions and 23 deletions

View file

@ -4,7 +4,7 @@ use cctk::{
wayland_client::{Connection, QueueHandle, WEnum},
};
use super::{AppData, Capture, CaptureSource, Event};
use super::{AppData, Capture, CaptureImage, CaptureSource, Event};
impl ScreencopyHandler for AppData {
fn screencopy_state(&mut self) -> &mut ScreencopyState {
@ -59,7 +59,8 @@ impl ScreencopyHandler for AppData {
}
let mut buffer = capture.buffer.lock().unwrap();
let image = unsafe { buffer.as_mut().unwrap().to_image() };
let img = unsafe { buffer.as_mut().unwrap().to_image() };
let image = CaptureImage { img };
match &capture.source {
CaptureSource::Toplevel(toplevel) => {
self.send_event(Event::ToplevelCapture(toplevel.clone(), image))