summaryrefslogtreecommitdiff
diff options
authorAndrea Azzarone <azzaronea@gmail.com>2012-09-28 03:10:48 +0200
committerAndrea Azzarone <azzaronea@gmail.com>2012-09-28 03:10:48 +0200
commitcc564013155afc3e24b987d9afdd19c631283708 (patch)
treece3fcb079e454ff053f01d50e650c33f6e05445e
parent3f9fb3f0e145a9397d828a2648bab1a8e1920cb1 (diff)
Use compiz tick-source.
(bzr r2762)
-rw-r--r--dash/DashView.cpp5
-rw-r--r--dash/DashView.h3
-rw-r--r--plugins/unityshell/src/unityshell.cpp14
-rw-r--r--plugins/unityshell/src/unityshell.h2
4 files changed, 13 insertions, 11 deletions
diff --git a/dash/DashView.cpp b/dash/DashView.cpp
index f55d132df..21a2a3b72 100644
--- a/dash/DashView.cpp
+++ b/dash/DashView.cpp
@@ -37,8 +37,6 @@
#include "unity-shared/UBusMessages.h"
#include "unity-shared/PreviewStyle.h"
-#include "Nux/NuxTimerTickSource.h"
-
namespace unity
{
namespace dash
@@ -96,9 +94,6 @@ DashView::DashView()
, opening_row_y_(-1)
, opening_row_height_(0)
{
- //tick_source_.reset(new nux::NuxTimerTickSource);
- //animation_controller_.reset(new na::AnimationController(*tick_source_));
-
renderer_.SetOwner(this);
renderer_.need_redraw.connect([this] () {
QueueDraw();
diff --git a/dash/DashView.h b/dash/DashView.h
index de3b487ab..43f7aca9f 100644
--- a/dash/DashView.h
+++ b/dash/DashView.h
@@ -23,7 +23,6 @@
#include <Nux/PaintLayer.h>
#include <Nux/View.h>
#include <Nux/VLayout.h>
-#include <Nux/NuxTimerTickSource.h>
#include <UnityCore/FilesystemLenses.h>
#include <UnityCore/HomeLens.h>
@@ -165,8 +164,6 @@ private:
float fade_out_value_;
float fade_in_value_;
- std::unique_ptr<nux::NuxTimerTickSource> tick_source_;
- std::unique_ptr<na::AnimationController> animation_controller_;
na::AnimateValue<float> animation_;
void FadeOutCallBack(float const& fade_out_value);
diff --git a/plugins/unityshell/src/unityshell.cpp b/plugins/unityshell/src/unityshell.cpp
index 61b948de2..6221f31c4 100644
--- a/plugins/unityshell/src/unityshell.cpp
+++ b/plugins/unityshell/src/unityshell.cpp
@@ -24,7 +24,6 @@
#include <Nux/HLayout.h>
#include <Nux/BaseWindow.h>
#include <Nux/WindowCompositor.h>
-#include <Nux/NuxTimerTickSource.h>
#include <UnityCore/Variant.h>
@@ -234,7 +233,7 @@ UnityScreen::UnityScreen(CompScreen* screen)
this));
#endif
- tick_source_.reset(new nux::NuxTimerTickSource);
+ tick_source_.reset(new na::TickSource);
animation_controller_.reset(new na::AnimationController(*tick_source_));
wt->RedrawRequested.connect(sigc::mem_fun(this, &UnityScreen::onRedrawRequested));
@@ -1301,6 +1300,10 @@ void UnityScreen::preparePaint(int ms)
{
cScreen->preparePaint(ms);
+ static long long big_tick = 0;
+ big_tick += ms*1000;
+ tick_source_->tick(big_tick);
+
for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows)
wi->HandleAnimations (ms);
@@ -1322,6 +1325,13 @@ void UnityScreen::donePaint()
if (didShellRepaint)
wt->ClearDrawList();
+ if (animation_controller_->HasRunningAnimations())
+ {
+ cScreen->damageRegionSetEnabled(this, false);
+ cScreen->damageScreen();
+ cScreen->damageRegionSetEnabled(this, true);
+ }
+
std::list <ShowdesktopHandlerWindowInterface *> remove_windows;
for (ShowdesktopHandlerWindowInterface *wi : ShowdesktopHandler::animating_windows)
diff --git a/plugins/unityshell/src/unityshell.h b/plugins/unityshell/src/unityshell.h
index a11ce4dd2..26785b1ca 100644
--- a/plugins/unityshell/src/unityshell.h
+++ b/plugins/unityshell/src/unityshell.h
@@ -246,7 +246,7 @@ private:
bool TopPanelBackgroundTextureNeedsUpdate() const;
void UpdateTopPanelBackgroundTexture();
- std::unique_ptr<nux::NuxTimerTickSource> tick_source_;
+ std::unique_ptr<na::TickSource> tick_source_;
std::unique_ptr<na::AnimationController> animation_controller_;
Settings dash_settings_;