rust-x-bindings / rust-xcb

Rust bindings and wrapper for XCB.
MIT License
161 stars 63 forks source link

Could xcb::Event be marked as Send? #233

Closed fabriziosestito closed 1 year ago

fabriziosestito commented 1 year ago

This will allow to use wait_for_event in a future such as:

tokio::spawn(async move {
    loop {
        let event = conn.wait_for_event().unwrap();
        match event {
            xcb::Event::X(event) => {
                sender.send(event).await.unwrap();
            }

            xcb::Event::Unknown(_) => {}
        };
    }
});
rtbo commented 1 year ago

This is actually a bug. Send and Sync is implemented for all event types except UnknownEvent.