Skip to content

poll_dispatch_pending does not behave as expected #570

@ids1024

Description

@ids1024

poll_dispatch_pending is documented as "similar to" dispatch_pending. But the behavior doesn't seem quite as expected.

If I use wayland-client in a GTK application, spawning a thread calling dispatch_pending in a loop successfully dispatches events for the code using wayland_client (though it's a busy loop). blocking_dispatch() also seems to work, apparently without interfering with GTK's own use of Wayland.

But spawning an async task on glib's executor with poll_fn(event_queue.poll_dispatch_pending()) doesn't allow the wayland-rs code to receive events from Wayland. I guess something needs to call wl_display_dispatch_queue/wl_display_dispatch_queue_pending for the event queue for the dispatcher function to be called, which then wakes the async task? Not sure if there's a better way to implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions