[PATCH wayland 2/2] server: use next serial in display_sync

Pekka Paalanen ppaalanen at gmail.com
Fri Nov 21 03:37:54 PST 2014

On Mon, 27 Oct 2014 09:14:41 +0100
Marek Chalupa <mchqwerty at gmail.com> wrote:

> Display sync sends always the same serial (if nothing intervenes
> and increases the serial for the sync).
> Signed-off-by: Marek Chalupa <mchqwerty at gmail.com>
> ---
>  src/wayland-server.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> diff --git a/src/wayland-server.c b/src/wayland-server.c
> index 674aeca..54284fa 100644
> --- a/src/wayland-server.c
> +++ b/src/wayland-server.c
> @@ -717,7 +717,7 @@ display_sync(struct wl_client *client,
>  		return;
>  	}
> -	serial = wl_display_get_serial(client->display);
> +	serial = wl_display_next_serial(client->display);
>  	wl_callback_send_done(callback, serial);
>  	wl_resource_destroy(callback);
>  }


wayland.xml specification for wl_display.sync says: "The callback_data
passed in the callback is the event serial."

However, I do not know what "the event serial" is. We have no generic
serials in Wayland.

We do use serials in places like matching shell requests to
input events, or cursor change to pointer motion, but our
implementation for those is less than correct. Weston calls
get_serial() in far too many places[1] and therefore ends up relying on
nothing calling next_serial() at inconvenient times.

Therefore I'd rather not push this patch before #83488 has been
implemented, and the serial usage in Weston fixed. Then this patch
would probably be fine.

It would be useful to verify, that we have a bug report for fixing
serial handling in Weston that depends on #83488, and another bug for
the problem your patch intends to fix, so we don't forget it completely.


[1] https://bugs.freedesktop.org/show_bug.cgi?id=83488

More information about the wayland-devel mailing list