[PATCH wayland 2/2] scanner: Generate all SINCE_VERSION macros for everyone
Yong Bakos
junk at humanoriented.com
Tue Jul 26 21:59:07 UTC 2016
On Jul 5, 2016, at 11:41 AM, Quentin Glidic <sardemff7+wayland at sardemff7.net> wrote:
>
> From: Quentin Glidic <sardemff7+git at sardemff7.net>
>
> Practical example: a client supporting version 2 of wl_output will wait
> for the wl_output.done event before starting wl_output-related
> operations. However, if the server only supports version 1, no event
> will ever come, and it must fallback to use the wl_output.geometry event
> alone.
> Without this macro, it cannot check for that in a nice way.
>
> Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
The rationale here makes sense, and I can't think of a 'nice' way to do
it without the client having access to the event version numbers. However,
Pekka or Giulio might.
Regardless, these defines don't inhibit anything, and this is
Reviewed-by: Yong Bakos <ybakos at humanoriented.com>
yong
> ---
>
> I do not have a real world use-case for the request macro on the server-side,
> but I guess you could do the same: wait the for a "commit" request if client is
> new enough, otherwise use some older request as commit.
>
> Actually I think there was something like that somewhere, now that I write that,
> but I do not remember where exactly.
>
>
> src/scanner.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/scanner.c b/src/scanner.c
> index 4708cae..a4c1984 100644
> --- a/src/scanner.c
> +++ b/src/scanner.c
> @@ -1544,10 +1544,12 @@ emit_header(struct protocol *protocol, enum side side)
> emit_structs(&i->request_list, i, side);
> emit_opcodes(&i->event_list, i);
> emit_opcode_versions(&i->event_list, i);
> + emit_opcode_versions(&i->request_list, i);
> emit_event_wrappers(&i->event_list, i);
> } else {
> emit_structs(&i->event_list, i, side);
> emit_opcodes(&i->request_list, i);
> + emit_opcode_versions(&i->event_list, i);
> emit_opcode_versions(&i->request_list, i);
> emit_stubs(&i->request_list, i);
> }
> --
> 2.9.0
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
More information about the wayland-devel
mailing list