Revision ef35572...

Go back to digest for 1st May 2011

Optimization in KDE Base

Sebastian Kügler committed changes in [plasma-mobile] /windowstrip:

Update frame animation once every 20msec to KWin

The rationale here is that kwin paints 50 frames per second, so we make
sure that the coordinates of the thumbnails are updated at least once
for every frame.

The mechanism is implemented using two timers, the frameUpdater
refreshes the coordinates from the QDeclarativeItem every 20msec. It's
started when an "animation event" (contentXChanged) arrives.
The frameController is started at the same time, but is a single shot.
It's there to stop updating the frame after 200msec, so the updating
only happens during animations.

This patch has the effect that it fills in frames in between that are
skipped because the contentXChanged signal doesn't fire often enough for
us to keep the animation updated.

I've removed the timer from the QML file, since that's now basically
redundant, and more performant in the C++ part (less signals crossing
QML -> C++). More code cleanup in here as well.

Indeed, it makes the animation feel much more smoothly, although there's
still a slight perceived lag when you start dragging.

File Changes

Modified 3 files
  • /windowstrip
  •   applets.cpp
  •   applets.h
  •   applets/qml/WindowStrip.qml
3 files changed in total