-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
poll_dispatch_pending
does not behave as expected
#570
Comments
The |
Unfortunately, no. |
That's unfortunate. I guess libwayland wouldn't want to run callbacks added by a different thread since they may not be thread-safe. This behavior should be described somewhere in the documentation. I think adding a GTK example would be good to show how to integrate wayland-rs with something else. I guess for simple uses at least, calling |
#572 has such a GTK example. So if there's a better way to do it, it can be demonstrated in that example. |
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 callingdispatch_pending
in a loop successfully dispatches events for the code usingwayland_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 callwl_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.The text was updated successfully, but these errors were encountered: