[Wayland-bugs] [Bug 83488] Document how serial should work

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Oct 31 04:24:07 PDT 2014


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

--- Comment #2 from Pekka Paalanen <ppaalanen at gmail.com> ---
(In reply to Marek Chalupa from comment #1)
> What about adding serial counter into wl_resource and relevant objects could
> have get_serial/next_serial for this (i.e. wl_keyboard_get/next_serial
> etc.)? If the serial would be specific to each object then AFAIK it wouldn't
> break anything in the current code. Actually, that is what I expect from the
> serials. When I get a pointer event with a serial, say A, and then get
> another pointer event with some other serial, say B, I would expect that the
> B serial is related only to A serial and is not affected by any other object.

wl_resource would be a wrong place in many ways. Not all objects need a serial
tag (variable), and certainly not a generator. The serial cannot work if it is
per-object, as objects are per-client or even multiple-per-client. One of the
goals is to prevent one client from hijacking things when another client is
already being targeted, e.g. cursor change after the pointer already moved onto
another client's surface. It would be more overhead to maintain serial tags of
each "thing" per-object, rather than having them per-"thing".

We only need one serial generator that is monotonic (rare wraparound allowed).
Then we need serial tags for each "thing", like a weston_seat or xdg_surface.
The tags are not per-client and not per-wl_resource. The important part is when
to assign a new serial into a tag (i.e. bump), and how to compare the serials
from clients to the correct tag.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-bugs/attachments/20141031/e1e12f4d/attachment.html>


More information about the wayland-bugs mailing list