01:25yrlf: Hi! I have a core wayland protocol question: is it guaranteed that singleton globals like xdg_output_manager appear before globals that can appear multiple times like wl_output?
01:25yrlf: or is the order of globals completely arbitrary
01:26yrlf: and the only thing that I can rely on is all singleton globals appearing after the first round trip
02:41zamundaaa[m]: yrlf: it's arbitrary
02:44danieldg: with wl_output v5 you mostly don't need xdg-output anyway
02:45danieldg: but yeah, if you need to bind it, you have to handle both orders
02:46danieldg: (sorry, v4)
03:01soreau: wl_output v4 has the output name finally?
03:04soreau: yrlf: the order of the globals depends on the order the compositor sends them
03:05soreau: but I don't think it's strictly guaranteed that all globals will be sent after a single roundtrip call; i.e. there's no 'done' event..
03:06soreau: sometimes I wonder if it's a good idea to write `while (!global) wl_display_roundtrip();`
03:07danieldg: soreau: globals are guaranteed to show up after one roundtrip
03:08danieldg: it's possible to add them later, but that's in response to events (monitor power-on, etc) and so more round-trips won't do anything but waste CPU
03:08danieldg: if it *wasn't* guaranteed then there would need to be an end
03:09soreau: danieldg: I mean what if there's a future where there's like.. a *lot* of protocols to advertise.. still guaranteed one roundtrip is enough?
03:10danieldg: yes, because you send one "global list request" and then one "sync" request, so the reply is "all globals" then "callback done"
03:10soreau: oh, so there is a done concept
03:10danieldg: that's how sync works
03:11danieldg: if you don't ask for a sync after asking for globals you don't know when it's done. But everyone does that.
03:11soreau: danieldg: everyone does what?
03:11soreau: sync or not?
03:11danieldg: send get_regitery and sync as the first two commands
03:12danieldg: look at WAYLAND_DEBUG=1 output from any client
03:16soreau: while debug does show sync calls, I don't see wl_display_sync called explicitly anywhere except in libwayland-client
03:16danieldg: roundtrip is "call sync and then wait for done before returning"
03:17danieldg: you could call sync yourself if you actually wanted to do things during startup (load stuff, for example)
03:17soreau: ah, that's like an xcb trick :)
03:18danieldg: or you can be boring and use threads like everyone else probably does
03:18soreau: ok, mystery solved
03:18soreau: danieldg: thanks
13:51wlb: wayland Issue #429 opened by Krzysztof Bochm (bochmkrzysztof) Code null pointer dereference in event loop epoll https://gitlab.freedesktop.org/wayland/wayland/-/issues/429