#wayland-client #event-source #windowing #wayland

calloop-wayland-source

A wayland-rs client event source for callloop

5 releases (3 breaking)

0.4.1 Sep 6, 2025
0.4.0 Aug 23, 2024
0.3.0 Mar 1, 2024
0.2.0 Sep 20, 2023
0.1.0 Jul 20, 2023

#4 in #event-source

Download history 317847/week @ 2025-11-12 399912/week @ 2025-11-19 333744/week @ 2025-11-26 368673/week @ 2025-12-03 401175/week @ 2025-12-10 368029/week @ 2025-12-17 248892/week @ 2025-12-24 288655/week @ 2025-12-31 478614/week @ 2026-01-07 489512/week @ 2026-01-14 602642/week @ 2026-01-21 584913/week @ 2026-01-28 524081/week @ 2026-02-04 487086/week @ 2026-02-11 513854/week @ 2026-02-18 533696/week @ 2026-02-25

2,156,608 downloads per month
Used in 995 crates (10 directly)

MIT license

13KB
144 lines

Utilities for using an EventQueue from wayland-client with an event loop that performs polling with calloop.

Example

use calloop::EventLoop;
use calloop_wayland_source::WaylandSource;
use wayland_client::{Connection, QueueHandle};

// Create a Wayland connection and a queue.
let connection = Connection::connect_to_env().unwrap();
let event_queue = connection.new_event_queue();
let queue_handle = event_queue.handle();

// Create the calloop event loop to drive everytihng.
let mut event_loop: EventLoop<()> = EventLoop::try_new().unwrap();
let loop_handle = event_loop.handle();

// Insert the wayland source into the calloop's event loop.
WaylandSource::new(connection, event_queue).insert(loop_handle).unwrap();

// This will start dispatching the event loop and processing pending wayland requests.
while let Ok(_) = event_loop.dispatch(None, &mut ()) {
    // Your logic here.
}

calloop-wayland-source

Use EventQueue from the wayland-client with the calloop.

Dependencies

~9–16MB
~234K SLoC