mpv
mpv copied to clipboard
add defines at configure time for wayland protocol interface versions
Maybe this is overengineering it but it's kind of dumb to not have this information at configure time in the first place.
Download the artifacts for this pull request:
Is it not sufficient to check #if HAVE_WAYLAND_PROTOCOLS_1_XX to determine the max version supported? It is already done to check the existence of some other protocols.
It is possible. But it doesn't solve the fundamental issue which is that we have no way of knowing interface versions at compile time. I think xdg_wm_base is the only thing that currently has this issue, but perhaps something like this would need to be done again in the future for some other protocol.
But again, it's kind of overengineering like I said.
But it doesn't solve the fundamental issue which is that we have no way of knowing interface versions at compile time.
It is possible by calculating the maximum value of all interested SINCE_VERSION macros, and limit wl_registry_bind to use that max value. If something isn't defined, don't include it in the calculation. In the mentioned issue, if XDG_TOPLEVEL_WM_CAPABILITIES_SINCE_VERSION (5) isn't defined, the calculated max protocol version will be less than 5.
It is possible by calculating the maximum value of all interested SINCE_VERSION macros, and limit wl_registry_bind to use that max value.
OK maybe I should have typed "sane way" to be more accurate. I would rather this or hack around in HAVE_WAYLAND_PROTOCOLS than do that.
FWIW, I'd prefer using SINCE_VERSION instead of manually parsing the interface XML files again, giving they are already parsed by wayland-scanner to generate the header files.
Maybe you could report it to the wayland-protos issue tracker so at least there's a chance we could get rid of this in the future?
I already have an open MR for wayland-scanner that adds this version information.
I'm waiting for a response from upstream before I decide what to do with this one.
We'll just hack around it for now. Hopefully upstream will be receptive to making scanner more useful later on.