From kwin Wed Jun 20 13:38:18 2007 From: =?utf-8?q?Lubo=C5=A1=20Lu=C5=88=C3=A1k?= Date: Wed, 20 Jun 2007 13:38:18 +0000 To: kwin Subject: KDE/kdebase/workspace/kwin Message-Id: <1182346698.231800.10199.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kwin&m=118234670900356 SVN commit 678025 by lunakl: 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 M +1 -1 clients/laptop/laptopclient.cpp M +2 -4 clients/modernsystem/modernsys.cpp M +1 -4 clients/plastik/plastik.cpp M +1 -4 clients/quartz/quartz.cpp M +1 -4 clients/web/Web.cpp M +1 -1 lib/kdecorationfactory.cpp --- trunk/KDE/kdebase/workspace/kwin/clients/laptop/laptopclient.cpp #678024:678025 @@ -703,7 +703,7 @@ Laptop::create_pixmaps(); bool needHardReset = true; - if (changed & SettingButtons) { + if ((changed & ~SettingButtons) == 0) { // handled by KCommonDecoration needHardReset = false; } --- trunk/KDE/kdebase/workspace/kwin/clients/modernsystem/modernsys.cpp #678024:678025 @@ -709,11 +709,9 @@ { 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; --- trunk/KDE/kdebase/workspace/kwin/clients/plastik/plastik.cpp #678024:678025 @@ -118,12 +118,9 @@ 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) { --- trunk/KDE/kdebase/workspace/kwin/clients/quartz/quartz.cpp #678024:678025 @@ -161,12 +161,9 @@ // 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) { --- trunk/KDE/kdebase/workspace/kwin/clients/web/Web.cpp #678024:678025 @@ -341,12 +341,9 @@ { // 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) { --- trunk/KDE/kdebase/workspace/kwin/lib/kdecorationfactory.cpp #678024:678025 @@ -39,7 +39,7 @@ bool KDecorationFactory::reset( unsigned long ) { - return false; + return true; } bool KDecorationFactory::supports( Ability ) _______________________________________________ Kwin mailing list Kwin@kde.org https://mail.kde.org/mailman/listinfo/kwin