Interesting way of checking if a decoration needs a hard reset - as soon

as one thing that does not need it has changed, it is not needed, regardless
of the rest. Even more interestingly several styles have exactly the same
copy of this nonsense.

CCMAIL: kwin@kde.org


svn path=/trunk/KDE/kdebase/workspace/; revision=678025
This commit is contained in:
Luboš Luňák 2007-06-20 13:38:17 +00:00
parent ef59c8956a
commit cc091a7704
6 changed files with 7 additions and 18 deletions

View file

@ -703,7 +703,7 @@ bool LaptopClientFactory::reset(unsigned long changed)
Laptop::create_pixmaps();
bool needHardReset = true;
if (changed & SettingButtons) {
if ((changed & ~SettingButtons) == 0) {
// handled by KCommonDecoration
needHardReset = false;
}

View file

@ -709,11 +709,9 @@ bool ModernSysFactory::reset( unsigned long changed )
{
delete_pixmaps();
create_pixmaps();
needHardReset = false;
} else if (changed & SettingButtons) {
// handled by KCommonDecoration
needHardReset = false;
}
if( ( changed & ~(SettingColors | SettingBorder | SettingFont | SettingButtons)) == 0 )
needHardReset = false;
if( needHardReset )
return true;

View file

@ -118,12 +118,9 @@ bool PlastikHandler::reset(unsigned long changed)
bool needHardReset = true;
// TODO: besides the Color and Font settings I can maybe handle more changes
// without a hard reset. I will do this later...
if (changed & SettingColors || changed & SettingFont)
if ((changed & ~(SettingColors | SettingFont | SettingButtons)) == 0 )
{
needHardReset = false;
} else if (changed & SettingButtons) {
// handled by KCommonDecoration
needHardReset = false;
}
if (needHardReset) {

View file

@ -161,12 +161,9 @@ bool QuartzHandler::reset(unsigned long changed)
// Do we need to "hit the wooden hammer" ?
bool needHardReset = true;
if (changed & SettingColors)
if ((changed & ~(SettingColors | SettingButtons)) == 0)
{
needHardReset = false;
} else if (changed & SettingButtons) {
// handled by KCommonDecoration
needHardReset = false;
}
if (needHardReset) {

View file

@ -341,12 +341,9 @@ bool WebFactory::reset(unsigned long changed)
{
// Do we need to "hit the wooden hammer" ?
bool needHardReset = true;
if (changed & SettingColors || changed & SettingFont)
if ((changed & ~(SettingColors | SettingFont | SettingButtons)) == 0 )
{
needHardReset = false;
} else if (changed & SettingButtons) {
// handled by KCommonDecoration
needHardReset = false;
}
if (needHardReset) {

View file

@ -39,7 +39,7 @@ KDecorationFactory::~KDecorationFactory()
bool KDecorationFactory::reset( unsigned long )
{
return false;
return true;
}
bool KDecorationFactory::supports( Ability )