You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently no way (as far as I can tell) to pass along unknown enum variants through requests. All APIs which take an enum expect a known enum variant.
Motivation
The zwlr_output_head_v1 protocol reports head transforms giving me WEnum<Transform>. I want to write these to disk, then in a future run, send them as part of a request in the zwlr_output_configuration_head_v1 protocol. Unfortunately, since the set_mode protocol takes a Transform instead of a WEnum<Transform>, my conversion is lossy. If the Transform enum is ever extended, my code breaks!
This is not limited to unstable protocols. In theory, you could want to do something similar with the wl_surface protocol (e,g, take the PreferredBufferTransform, and conditionally replace it to some other transform).
The text was updated successfully, but these errors were encountered:
Exactly how enums like this are supposed to be used seems a bit ambiguous in Wayland, generally. Hopefully https://gitlab.freedesktop.org/wayland/wayland/-/issues/497 can address this. I think we'd want to use WEneum for "open" enums, but just the contained type for closed ones? Though I don't know how that would work with something like zwlr_output_head_v1 where the enum is defined in a different protocol.
andriyDev
added a commit
to andriyDev/wl-distore
that referenced
this issue
Oct 21, 2024
There is currently no way (as far as I can tell) to pass along unknown enum variants through requests. All APIs which take an enum expect a known enum variant.
Motivation
The
zwlr_output_head_v1
protocol reports head transforms giving meWEnum<Transform>
. I want to write these to disk, then in a future run, send them as part of a request in thezwlr_output_configuration_head_v1
protocol. Unfortunately, since theset_mode
protocol takes aTransform
instead of aWEnum<Transform>
, my conversion is lossy. If theTransform
enum is ever extended, my code breaks!This is not limited to unstable protocols. In theory, you could want to do something similar with the
wl_surface
protocol (e,g, take thePreferredBufferTransform
, and conditionally replace it to some other transform).The text was updated successfully, but these errors were encountered: