kwin clients - virtual colorsSupported()?

Lubos Lunak l.lunak at suse.cz
Tue Nov 27 21:30:45 GMT 2007


On Ășt 27. listopadu 2007, Aaron J. Seigo wrote:
> On Tuesday 27 November 2007, Matthew Woehlke wrote:
> > Ok. aseigo and I talked on IRC, and came up with two recommended
> > solutions:
> >
> > 1. add color types to Ability
> >    + no new API, BC
> >    - all clients must be updated or result will be wrong
>
> the reason for "result will be wrong" would be code in a client that has a
> switch statement like this:
>
> switch (ability) {
> 	case $SupportAbility:
> 	case $AnotherSupportAbility:
> 		return true;
> 		break;
> 	default:
> 		return false;
> }
>
> obviously that would result in no colour settings. i don't know if such
> code is common in kwin clients, but i can see that happening rather easily.

 There would be a flag saying whether the client supports announcing it at 
all. If it's not set, do whatever should be the (backwards-compatible) 
default.

> > 2a. add 'virtual supports(ColorType) const;' to KDecorationFactory
> >    + reuses existing enum
> >    - BIC
> >    - clients might forget to override it
>
> at least this is easy to notice (colours set aren't used) and the worst
> case scenario is that we have the same problems we have now. so no
> regressions and with a way to fix the current bug at our disposal, without
> having to touch every single client either.

 In this regard this seems to be the same like 1., with "+ there's only one 
place for specifying abilities".

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http//www.suse.cz




More information about the kde-core-devel mailing list