wl_output identifiers
Per the discussion herehttps://gitlab.freedesktop.org/wayland/wayland-protocols/-/issues/130#note_1753185 there isn't really a nice way to handle output arguments in an event.
This is something I'd like to get figured out so I can push through on the ext-foreign-toplevel-state protocol.
There is the easy route of course: send every output through events. This works but is kind of ugly to be fair.
Similar to how ext-foreign-toplevel-list added an identifier string to handle referencing an output across instances of handles and processes, maybe it would be worth considering the same for wl_output? Pretty much the same type of string, 32 printable ascii characters, identifiers can't be reused, generated per compositor instance (so no serializing an identifier) and whatever else was defined for foreign-toplevel-list.
Alternatives
An alternative could be to have extension protocols define an object to extend an output. This would only cause things to be sent to the extension, but if two instances of the same real wl_output global are extended we have to send everything to both again...