about wl_display_poll

Daniel Stone daniel at fooishbar.org
Mon Nov 9 18:09:17 UTC 2020


Hi Leo,

On Mon, 9 Nov 2020 at 16:17, enpeng xu <enpengxu at gmail.com> wrote:
> I have a question about the functions of wl_display_dispatch/wl_display_poll.
> In the function wl_display_poll, it ignores EINTR and keeps polling until it gets an event from remote.
> I am not sure if this is the expected, but a typical user case is, user setup a signal handler and run a event loop by calling wl_display_dispatch_queue,
> It expects the signal handler to set a stop flag and event loop will abort the loop if the stop is true. but in practice, wl_display_poll will keep being blocked and there is no way to exit the event loop.
>
> Is there any reason behind  in doing it? or should we provide an interruptible version of wl_display_dispatch ?

You can easily write your own interruptible/non-dominant version, you
just have to expand what that function does internally:
    https://wayland.freedesktop.org/docs/html/apb.html#Client-classwl__display_1a40039c1169b153269a3dc0796a54ddb0

Cheers,
Daniel


More information about the wayland-devel mailing list