[PATCH wayland] client: add wl_proxy_get_version function
Pekka Paalanen
ppaalanen at gmail.com
Mon Oct 6 01:26:56 PDT 2014
On Mon, 6 Oct 2014 10:45:14 +0300
Pekka Paalanen <ppaalanen at gmail.com> wrote:
> Re-adding CCs and some more...
>
> On Mon, 06 Oct 2014 09:17:41 +0300
> Rémi Denis-Courmont <remi at remlab.net> wrote:
>
> > Hello,
> >
> > Le 2014-10-06 03:29, Jason Ekstrand a écrit :
> > > Remi,
> > > While this would probably be nice, your approach isnt going to work.
> >
> > Yeah, I figured that much after I submitted the patch. And then I
> > rediscovered that the client library does not actually know the version
> > of the project objects, and wl_registry_bind() cannot be modified
> > without breaking backward compatibility.
> >
> > But now, I am even wondering whether this makes any sense. Assuming
> > wl_proxy_get_version() gets implemented "somehow", what should the
> > library do if the proxy version is *higher* than version the library
> > knows of? Say a new version Y of an interface FOO adds a new request and
> > a new event compared to older version X. If a FOO object is instantiated
> > with version Y but the new request is never used and there is no event
> > handler for the new event, will it still work as with version X? I guess
> > not :-(
>
> If there is no event handler set, the client will abort/crash if the
> event is ever sent.
>
> > In my specific case, can the Wayland client treat a wl_surface version
> > 4 or higher as a wl_surface version 3? If not, I cannot rely on
> > 'wl_proxy_get_version(surface) >= 2'...
>
> Changing the semantics[5] of wl_surface.damage is a good example where
> this would fail indeed. If a library only knows up to version 3, but
> the app gives it a wl_surface of version 4, the damage coordinates
> would be wrong.
>
> Originally we had the idea, that all version bumps are backwards
> compatible. Simply testing for version >= X would always work. The
> wl_surface.damage change is not backwards compatible in that sense.
>
> Looks to me like if we don't fix damage, then this versioning problem
> would be solvable... :-(
Oh I'm being silly, we only need to fix damage in a backward compatible
way: add a new request, don't modify the behaviour of the old one.
Keeping backward compatibility wrt. version >= X checks seems like a
good idea and should reduce the problem set somewhat.
> [5] https://bugs.freedesktop.org/show_bug.cgi?id=78190
Thanks,
pq
More information about the wayland-devel
mailing list