[PATCH] Bug fix client apps because of output change

Pekka Paalanen ppaalanen at gmail.com
Tue Mar 11 01:25:48 PDT 2014


On Tue, 11 Mar 2014 01:48:49 +0000
"Wang, Quanxian" <quanxian.wang at intel.com> wrote:

> Thanks.
> 
> Quanxian
> 
> >> >binds with version 2 regardless of what the compositor advertised.
> >> >
> >> >You can compare to the "desktop_shell" global handling which seems
> >> >correct.
> >> [Wang, Quanxian] I will check and update that. The change will be
> >> like that 1293         output->output =
> >> 1294                 display_bind(desktop->display, id,
> >> &wl_output_interface, version); 1295         output->server_output_id
> >> = id; 1296         output->interface_version = (version < 2) ?
> >> version : 2;
> >
> >Do not use the server advertized version in bind without checking it first. If the
> >server version grows, the client still needs to bind with the old version, until the
> >client code is ported to support the new version.
> [Wang, Quanxian] Sorry for misunderstanding the interface version issue. Currently my understanding is that client apps(desktop-shell) is based on wl_output which version is under 2(including 2), so whatever wl_output upgrade or not, we can use only the function provided by wl_output interface under the version 2. Right?
> Another question is, since version is from server, why not keep it as original value? when you do some operation, you just check and choose what needed based on the value(just like update_output). My suggestion is when you upgrade client app to use wl_output, we don't need to continue maintain such code.(For example from 2 to 3). The only update is the new code which want to use new function provided by newly wl_output interface. What is your idea about that?
> >

Let me put it more clearly. The client has been coded to support
version 2. The server advertises version N. The agreed interface
version that both can deal with is then min(2, N).

You have to tell the server, what the agreed version is: you have to
call display_bind() with version min(2, N). This way the server knows,
that it must not send events added in versions 3 or greater, because
those would crash the client.

Also the client knows, that it cannot use requests added in versions
N+1 or greater.

It does not matter whether you set output->interface_version = N or
min(2, N), because the code in the client is anyway comparing that to
what it actually is coded for. It's just more logical to me to store
the agreed version, not the server version.


Thanks,
pq


More information about the wayland-devel mailing list