Merge lp:~dbarth/unity/disable-cache into lp:unity

Proposed by David Barth
Status: Merged
Approved by: Gord Allott
Approved revision: no longer in the source branch.
Merge reported by: David Barth
Merged at revision: not available
Proposed branch: lp:~dbarth/unity/disable-cache
Merge into: lp:unity
Diff against target: 87 lines (+41/-1)
4 files modified
unity-private/Makefile.am (+1/-0)
unity-private/launcher/launcher.vala (+3/-1)
unity-private/panel/panel-view.vala (+4/-0)
unity-private/unity-quirks.vala (+33/-0)
To merge this branch: bzr merge lp:~dbarth/unity/disable-cache
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+37117@code.launchpad.net

Description of the change

Env. variable quirk to disable effects caches for the panel and the launcher.

To post a comment you must log in.
Revision history for this message
Mikkel Kamstrup Erlandsen (kamstrup) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'unity-private/Makefile.am'
2--- unity-private/Makefile.am 2010-09-16 12:42:01 +0000
3+++ unity-private/Makefile.am 2010-10-01 09:25:59 +0000
4@@ -72,6 +72,7 @@
5 private_sources = \
6 application.vala \
7 unity.vala \
8+ unity-quirks.vala \
9 utils.vala
10
11 panel_sources = \
12
13=== modified file 'unity-private/launcher/launcher.vala'
14--- unity-private/launcher/launcher.vala 2010-08-02 09:16:36 +0000
15+++ unity-private/launcher/launcher.vala 2010-10-01 09:25:59 +0000
16@@ -32,8 +32,10 @@
17
18 this.cache = new Ctk.EffectCache ();
19 this.add_effect (this.cache);
20-
21 this.cache.update_texture_cache ();
22+
23+ if (Unity.Quirks.effects_disabled ())
24+ this.remove_effect (cache);
25 }
26
27 construct
28
29=== modified file 'unity-private/panel/panel-view.vala'
30--- unity-private/panel/panel-view.vala 2010-09-13 15:46:12 +0000
31+++ unity-private/panel/panel-view.vala 2010-10-01 09:25:59 +0000
32@@ -92,6 +92,7 @@
33 button_release_event.connect (on_button_release_event);
34
35 cache = new Ctk.EffectCache ();
36+
37 add_effect (cache);
38 cache.update_texture_cache ();
39 hbox.queue_redraw.connect (() => {
40@@ -99,6 +100,9 @@
41 cache.update_texture_cache ();
42 });
43
44+ if (Unity.Quirks.cache_disabled ())
45+ remove_effect (cache);
46+
47 END_FUNCTION ();
48 }
49
50
51=== added file 'unity-private/unity-quirks.vala'
52--- unity-private/unity-quirks.vala 1970-01-01 00:00:00 +0000
53+++ unity-private/unity-quirks.vala 2010-10-01 09:25:59 +0000
54@@ -0,0 +1,33 @@
55+/*
56+ * Copyright (C) 2010 Canonical Ltd
57+ *
58+ * This program is free software: you can redistribute it and/or modify
59+ * it under the terms of the GNU General Public License version 3 as
60+ * published by the Free Software Foundation.
61+ *
62+ * This program is distributed in the hope that it will be useful,
63+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
64+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
65+ * GNU General Public License for more details.
66+ *
67+ * You should have received a copy of the GNU General Public License
68+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
69+ *
70+ * Authored by David Barth <david.barth@canonical.com>
71+ *
72+ */
73+
74+namespace Unity.Quirks
75+{
76+ public bool cache_disabled ()
77+ {
78+ string? cache = Environment.get_variable ("UNITY_DISABLE_CACHE");
79+ return (cache != null) ? true : false;
80+ }
81+
82+ public bool effects_disabled ()
83+ {
84+ string? effects = Environment.get_variable ("CLUTK_DISABLE_EFFECTS");
85+ return (effects != null) ? true : false;
86+ }
87+}