Re: Interaction between applications and compositing managers



On Mon, 10 Apr 2006 20:29:07 -0400 Matthias Clasen <mclasen redhat com> babbled:

> On Tue, 2006-04-11 at 09:02 +0900, Carsten Haitzler wrote:
> 
> > switch statements with no default: case (and an assumption that all the
> > members in the switch are the only valid values and if no switch case is
> > executed "bad things" (tm) will happem) switching on EXTERNALLY provided
> > values (ie from a property read from x) are just fundamentally broken from
> > the start - bugs waiting to happen. i would not consider this an api break.
> > it's an api addition. the original code was/is broken. never trust data you
> > read from properties to always be correct and sane - nasty applications
> > could try cause havoc by maliciously mangling properties or simply bugs in
> > software on clients could do the same. reading x properties is like reading
> > any protocol over a wire to an untrusted client - you double check  what
> > you get and never assume it is sane and correct.
> > 
> > so my point - it's not a pi break at all adding extra enumerations. the code
> > should have already handled the case of an enumeration it doesn't know
> > about to start with in some "sane" fashion.
> > 
> 
> This is not about trusting values from properties (which of course, you
> must not do), it is about GDK apis which have a C enum for the possible
> values of the window type. Adding new values does indeed force us to
> break the api by adding new values to the enumeration. I do agree that
> the api break is minor and that we should probably do it, but it is an
> api break, unless the enumeration is explicitly documented as "may grow
> new values", which is isn't.

i would always ASSUME any enumeration could grow - handle known valid values at
the time of writing - and have a catch-all for anything else you don't know
about, UNLESS you control both sides of the "protocol" i would always do this
and since this deals with a "protocol" (which netwm/icccm effectively is) i
would always assume it may be expanded in future. :) but then again - i write
wm's - a lot. i have a twisted view of the world. :)

> Matthias
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster rasterman com
裸好多
Tokyo, Japan (東京 日本)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]