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

@ -33,7 +33,6 @@ use cctk::{
use cosmic::iced::{
self,
futures::{executor::block_on, FutureExt, SinkExt},
widget::image,
};
use futures_channel::mpsc;
use std::{
@ -67,7 +66,7 @@ pub enum Event {
WorkspaceCapture(
zcosmic_workspace_handle_v1::ZcosmicWorkspaceHandleV1,
wl_output::WlOutput,
image::Handle,
CaptureImage,
),
NewToplevel(
zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
@ -80,11 +79,16 @@ pub enum Event {
CloseToplevel(zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1),
ToplevelCapture(
zcosmic_toplevel_handle_v1::ZcosmicToplevelHandleV1,
image::Handle,
CaptureImage,
),
Seats(Vec<wl_seat::WlSeat>),
}
#[derive(Clone, Debug)]
pub struct CaptureImage {
pub img: iced::widget::image::Handle,
}
pub fn subscription(conn: Connection) -> iced::Subscription<Event> {
iced::subscription::run_with_id("wayland-sub", async { start(conn) }.flatten_stream())
}