Unable to set event queue
I am unable to set a custom event queue to the main display object via wl_proxy_set_queue()
.
This seems to stem from:
-
wl_list_remove(&proxy->queue_link)
being called on an uninitializedqueue_link
attribute (see https://gitlab.freedesktop.org/wayland/wayland/-/blob/main/src/wayland-client.c#L2374), - which will segfault in
wl_list_remove()
becauseelm = {prev=0x0, next=0x0}
essentially (see https://gitlab.freedesktop.org/wayland/wayland/-/blob/main/src/wayland-util.c#L56).
I briefly looked at the source and the commit that introduces this attribute and I cannot find a proper place where to initialize this myself. Internally wl_list_init(&proxy->queue_link)
seems to only be initialized when wl_event_queue_release()
or proxy_destroy()
is called, and these seem to be static functions.
Minimimal reproduction example:
# File: main.c
#include <wayland-client.c>
int
main (void)
{
struct wl_display *display = wl_display_connect(NULL);
struct wl_event_queue *queue = wl_display_create_queue(display);
wl_proxy_set_queue((struct wl_proxy *)display, queue);
return 0;
}
Compile with gcc -lwayland-client main.c
, run with ./a.out
.
In case I am doing something wrong - which is totally possible - let me know where to find a proper explanation of how to create custom event queues.
Thanks!
Edit:
I have forgotten to mention: I am fairly sure that this worked prior to wayland-1.22. And the commit that introduced the wl_list_remove()
call was 3 months ago: 674145dc