clamp timeline time for highlighted desktop

BUG: 327539
FIXED-IN: 4.11.4
This commit is contained in:
Thomas Lübking 2013-11-16 16:37:22 +01:00
parent 54a4a4547d
commit c003baee1e

View file

@ -914,7 +914,12 @@ void DesktopGridEffect::setHighlightedDesktop(int d)
{
if (d == highlightedDesktop || d <= 0 || d > effects->numberOfDesktops())
return;
if (highlightedDesktop > 0 && highlightedDesktop <= hoverTimeline.count())
hoverTimeline[highlightedDesktop-1]->setCurrentTime(qMin(hoverTimeline[highlightedDesktop-1]->currentTime(),
hoverTimeline[highlightedDesktop-1]->duration()));
highlightedDesktop = d;
if (highlightedDesktop <= hoverTimeline.count())
hoverTimeline[highlightedDesktop-1]->setCurrentTime(qMax(hoverTimeline[highlightedDesktop-1]->currentTime(), 0));
effects->addRepaintFull();
}