summaryrefslogtreecommitdiff
diff options
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2016-07-04 16:51:28 +0200
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2016-07-04 16:51:28 +0200
commit1a01d48adcf5c273fe60a042f49a812d65401996 (patch)
tree23a52b0886a8adfccc34f9f1748c2bd2fbbef537
parent2aebface45bb16088866870da1e6702e88c15e62 (diff)
BGHash: disable animation on low_gfx
(bzr r4132.6.6)
-rw-r--r--unity-shared/BGHash.cpp7
-rw-r--r--unity-shared/BGHash.h2
2 files changed, 7 insertions, 2 deletions
diff --git a/unity-shared/BGHash.cpp b/unity-shared/BGHash.cpp
index d0ec71b8e..d681404da 100644
--- a/unity-shared/BGHash.cpp
+++ b/unity-shared/BGHash.cpp
@@ -20,6 +20,7 @@
#include "BGHash.h"
#include <gdk/gdkx.h>
#include <NuxCore/Logger.h>
+#include "unity-shared/UnitySettings.h"
#include "unity-shared/WindowManager.h"
#ifndef XA_STRING
@@ -38,13 +39,17 @@ namespace
}
BGHash::BGHash()
- : transition_animator_(TRANSITION_DURATION)
+ : transition_animator_(Settings::Instance().low_gfx() ? 0 : TRANSITION_DURATION)
, override_color_(nux::color::Transparent)
{
COLORS_ATOM = gdk_x11_get_xatom_by_name("_GNOME_BACKGROUND_REPRESENTATIVE_COLORS");
transition_animator_.updated.connect(sigc::mem_fun(this, &BGHash::OnTransitionUpdated));
WindowManager::Default().average_color = unity::colors::Aubergine;
RefreshColor(/* skip_animation */ true);
+
+ Settings::Instance().low_gfx.changed.connect(sigc::track_obj([this] (bool low_gfx) {
+ transition_animator_.SetDuration(low_gfx ? 0 : TRANSITION_DURATION);
+ }, *this));
}
uint64_t BGHash::ColorAtomId() const
diff --git a/unity-shared/BGHash.h b/unity-shared/BGHash.h
index 680f53afe..1c981c5a4 100644
--- a/unity-shared/BGHash.h
+++ b/unity-shared/BGHash.h
@@ -30,7 +30,7 @@ namespace colors {
namespace unity
{
- class BGHash
+ class BGHash : public sigc::trackable
{
public:
BGHash();