1use std::time::Duration;
2use tokio::{sync::{mpsc, oneshot}, time::sleep};
3use wayland_client::protocol::wl_output::Transform;
4use wayland_protocols_async::zwlr_output_management_v1::handler::{OutputManagementHandler, OutputManagementMessage};
5
6#[tokio::main]
7async fn main() {
8 let (output_msg_tx, mut output_msg_rx) = mpsc::channel(128);
10
11 let (output_event_tx, mut output_event_rx) = mpsc::channel(128);
13
14 let mut output_handler = OutputManagementHandler::new(output_event_tx);
16
17
18 let output_t = tokio::spawn(async move {
20 let _ = output_handler.run(output_msg_rx).await;
21 });
22
23 let output_event_t = tokio::spawn(async move {
25 loop {
26 let msg = output_event_rx.recv().await;
27 if msg.is_none() {
28 continue;
29 }
30 println!("received output_event event={:?}", msg);
31 }
32 });
33
34 let _ = output_t.await.unwrap();
35 let _ = output_event_t.await.unwrap();
36}