Fix double->int conversions to prevent incorrect rounding of window

opacity at KWin start and window focus change.
BUG: 209274

svn path=/trunk/KDE/kdebase/workspace/; revision=1030828
This commit is contained in:
Lucas Murray 2009-10-03 09:11:05 +00:00
parent 4d1bdd5a63
commit 3dc41fb062
2 changed files with 5 additions and 3 deletions

View file

@ -861,7 +861,9 @@ void Client::setActive( bool act )
if ( active == act )
return;
active = act;
const int ruledOpacity = active ? rules()->checkOpacityActive(opacity()*100) : rules()->checkOpacityInactive(opacity()*100);
const int ruledOpacity = active
? rules()->checkOpacityActive( qRound( opacity() * 100.0 ))
: rules()->checkOpacityInactive( qRound( opacity() * 100.0 ));
setOpacity( ruledOpacity/100.0 );
workspace()->setActiveClient( act ? this : NULL, Allowed );

View file

@ -854,11 +854,11 @@ void Client::applyWindowRules()
// see also Client::setActive()
if( isActive())
{
setOpacity( rules()->checkOpacityActive(opacity()*100)/100.0 );
setOpacity( rules()->checkOpacityActive( qRound( opacity() * 100.0 )) / 100.0 );
workspace()->disableGlobalShortcutsForClient( rules()->checkDisableGlobalShortcuts( false ));
}
else
setOpacity( rules()->checkOpacityInactive(opacity()*100)/100.0 );
setOpacity( rules()->checkOpacityInactive( qRound( opacity() * 100.0 )) / 100.0 );
}
void Client::updateWindowRules()