use crate::ipc::{self, new_listener, Connection, Data};
use hbb_common::{
allow_err,
anyhow::anyhow,
bail, log, sleep,
tokio::{
self,
sync::mpsc::{unbounded_channel, UnboundedReceiver, UnboundedSender},
time::interval_at,
},
ResultType,
};
use lazy_static::lazy_static;
use serde_derive::{Deserialize, Serialize};
use softbuffer::{Context, Surface};
use std::{
collections::HashMap,
num::NonZeroU32,
sync::{Arc, RwLock},
time::Instant,
};
#[cfg(target_os = "linux")]
use tao::platform::unix::WindowBuilderExtUnix;
#[cfg(target_os = "windows")]
use tao::platform::windows::WindowBuilderExtWindows;
use tao::{
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoopBuilder, EventLoopProxy},
window::WindowBuilder,
};
use tiny_skia::{Color, FillRule, Paint, PathBuilder, PixmapMut, Point, Stroke, Transform};
use ttf_parser::Face;
lazy_static! {
static ref EVENT_PROXY: RwLock