[PATCH] Xi: check all handlers before applying property changes.
peter.hutterer at who-t.net
Tue Oct 7 23:34:36 PDT 2008
On Wed, Oct 08, 2008 at 08:11:26AM +0200, Simon Thum wrote:
> Peter Hutterer wrote:
> > The current code exposes to inconsistent updates, i.e. if handler N succeeds
> > but handler N+1 fails in setting the property, an error is returned to the
> > client although parts of the server now behave as if the property change
> > succeeded.
> I understand the problem, but are there really uses for this? I mean, 2
> handlers responding to the same prop is nothing I could make sense of.
> At most, an additional handler which 'watches' the prop this way is
> conceivable to me.
Axis range changes are one example I can think of. The driver needs to update
it for axis inversion, the server for scaling.
> > This patch adds a "checkonly" parameter to the SetProperty handler. The
> > handlers are then called twice, once with checkonly set to TRUE.
> > On the checkonly run, handlers _MUST_ return error codes if the property
> > cannot be applied. Handlers are not permitted to actually apply the changes.
> > On the second run, handlers are permitted to apply property changes.
> > Errors codes returned on the second run are ignored.
> Things could be simpler IMO when having different return codes for 'I
> don't care' vs. 'Yep, property properly changed'. I think that's the
> root of the problem.
No, this doesn't help if handler 1 reports "properly changed" and handler 2
reports a BadValue (for whatever reason).
Since the property handlers don't change the actual property value (that's
done in the server on Success), "Don't care" is essentially the same as
"properly changed" to the server.
More information about the xorg