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

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Oct 31 03:14:57 PDT 2014


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

--- Comment #1 from Marek Chalupa <mchqwerty at gmail.com> ---
Hi,

I noticed this bug few days ago. Before I read this I sent a patch for bumping
serials in disply_sync. After reading this, I got unsure whether the patch is
correct.. but, yes, I think we should use different serial for each callback.
Problem is that it could break things.

> < pq> one of the presumably latest additions is xdg_send_configure(), which
> wants to use a  totally unrelated serial to match configure to ack_configure
> 
> < daniels> ugh, yes
> 
> < daniels> that's the main one i can see which is objectively broken
> 
> < pq> we only have one serial source counter in wl_display, so I think we
> should be  wl_display_get_serial()'ing a lot less than we do now
> 
> < daniels> that really needs to be in a separate namespace
> 
> < pq> well, wouldn't we need one serial generator per wl_seat?
> 
> < pq> I mean namespace
> 
> < daniels> bumping serial on focus change is definitely broken too, though i
> guess probably  inadvertently gets us the behaviour we want :P
> 
> < daniels> i.e. if you click on the titlebar of an unfocused window, you
> don't want to start a  move
> 
> < daniels> so it might be that clients are trying to start moves with the
> button-down serial,  which then gets rejected because focus is newer :P
> 
> < daniels> namespace/generator no, comparator yes
> 
> < daniels> i.e. store last_serial in wl_seat rather than wl_display, and use
> that to compare  against
> 
> < pq> http://pastie.org/pastes/9526493/text  for get_serial usage
> 
> < daniels> keymap bumping serial is a little questionable too, but trying to
> relate events  across keymap changes is ... ugh
> 
> < pq> daniels, serials are already stored separately to be compared against,
> but the serials  sent to clients are retrieved from wl_display, which may
> have advanced for unrelated  reasons
> 
> < daniels> hmmm, yes
> 
> < daniels> right, so get_serial should also be retrieving from wl_seat where
> it relates to that

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.

-- 
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/4f30bc4d/attachment.html>


More information about the wayland-bugs mailing list