winit_wayland/event_loop/
proxy.rs1use std::sync::Arc;
4
5use sctk::reexports::calloop::ping::Ping;
6use winit_core::event_loop::{EventLoopProxy as CoreEventLoopProxy, EventLoopProxyProvider};
7
8#[derive(Debug)]
10pub struct EventLoopProxy {
11 ping: Ping,
12}
13
14impl EventLoopProxyProvider for EventLoopProxy {
15 fn wake_up(&self) {
16 self.ping.ping();
17 }
18}
19
20impl EventLoopProxy {
21 pub fn new(ping: Ping) -> Self {
22 Self { ping }
23 }
24}
25
26impl From<EventLoopProxy> for CoreEventLoopProxy {
27 fn from(value: EventLoopProxy) -> Self {
28 CoreEventLoopProxy::new(Arc::new(value))
29 }
30}