ChanServ changed the topic of #wayland to: https://wayland.freedesktop.org | Discussion about the Wayland protocol and its implementations, plus libinput
co1umbarius has joined #wayland
columbarius has quit [Ping timeout: 480 seconds]
Brainium has quit [Quit: Konversation terminated!]
<Vanfanel>
kennylevinsen: I have another small problem (the last one I hope). If I call wl_display_dispatch() after calling wl_display_prepare_read_queue(), then wl_display_dispatch() blocks forever.
<Vanfanel>
In theory, wl_display_dispatch() blocks forever if there are no new events to process, but shouldn't the previous eglSwapBuffers() produce an event to be processed?
fmuellner has joined #wayland
nerdopolis has joined #wayland
<daniels>
Vanfanel: no because it uses a dedicated queue
<daniels>
please see the wl_display_prepare_read_queue docs
<daniels>
you can’t just use a random throwaway queue but you need a real queue and need to use it consistently, and you also need the loop in the code snippet in the docs
<Vanfanel>
daniels: do you mean eglSwapBuffers() uses a dedicated queue?
<kennylevinsen>
yes, in order to never dispatch your events as this would cause issues
bodiccea_ has quit [Remote host closed the connection]
<Vanfanel>
My understanding is that the wl_display already has a queue, because wl_display_dispatch() doesn't block forever unless I call wl_display_prepare_read_queue() previously.
<Vanfanel>
Isn't it possible to simply use that default queue?
bodiccea has joined #wayland
<daniels>
yeah, if you’re on the default queue then use wl_display_prepare_read with no queue arg
<daniels>
and also do the read on the fd, and the loop, and the dispatch_pending
<daniels>
either do that loop as in the docs, or just run wl_display_dispatch in a loop
<daniels>
don’t mix and match the two things
<Vanfanel>
daniels: First problem I am encountering is that passing NULL as second argument to wl_display_prepare_read_queue() causes a segfault. Of course, the wl_display is initialized and working. Any idea om why could that be happening? That should use the default wl_display queue, shouldn't it?
<Vanfanel>
Maybe I understood it wring but, how am I supposed to use wl_display_prepare_read with no queue arg?
<Vanfanel>
I mean, a second arg is needed.
<daniels>
Vanfanel: no, I literally mean wl_display_prepare_read(), which does not take a queue arg. you use this if you are using the default queue. the _queue() variant is only usable if you have a queue you’ve created and your events are going to (you do not)
<daniels>
but this is _still_ wrong, though less wrong. just call wl_display_dispatch() in a loop until you get your event. do not call prepare_read without reading from the fd
<Vanfanel>
Ah sorry, thanks for your patience really