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

Submitted by Marek Chalupa on Oct. 27, 2014, 8:14 a.m.

Details

Message ID 1414397681-10678-2-git-send-email-mchqwerty@gmail.com
State Changes Requested
Headers show

Not browsing as part of any series.

Commit Message

Marek Chalupa Oct. 27, 2014, 8:14 a.m.
Display sync sends always the same serial (if nothing intervenes
and increases the serial for the sync).

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
---
 src/wayland-server.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

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);
 }

Comments

On Mon, 27 Oct 2014 09:14:41 +0100
Marek Chalupa <mchqwerty@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@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);
>  }

Hi,

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.


Thanks,
pq

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