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
=== modified file 'unity-private/Makefile.am'
--- unity-private/Makefile.am 2010-09-16 12:42:01 +0000
+++ unity-private/Makefile.am 2010-10-01 09:25:59 +0000
@@ -72,6 +72,7 @@
72private_sources = \72private_sources = \
73 application.vala \73 application.vala \
74 unity.vala \74 unity.vala \
75 unity-quirks.vala \
75 utils.vala76 utils.vala
7677
77panel_sources = \78panel_sources = \
7879
=== modified file 'unity-private/launcher/launcher.vala'
--- unity-private/launcher/launcher.vala 2010-08-02 09:16:36 +0000
+++ unity-private/launcher/launcher.vala 2010-10-01 09:25:59 +0000
@@ -32,8 +32,10 @@
3232
33 this.cache = new Ctk.EffectCache ();33 this.cache = new Ctk.EffectCache ();
34 this.add_effect (this.cache);34 this.add_effect (this.cache);
35
36 this.cache.update_texture_cache ();35 this.cache.update_texture_cache ();
36
37 if (Unity.Quirks.effects_disabled ())
38 this.remove_effect (cache);
37 }39 }
3840
39 construct41 construct
4042
=== modified file 'unity-private/panel/panel-view.vala'
--- unity-private/panel/panel-view.vala 2010-09-13 15:46:12 +0000
+++ unity-private/panel/panel-view.vala 2010-10-01 09:25:59 +0000
@@ -92,6 +92,7 @@
92 button_release_event.connect (on_button_release_event);92 button_release_event.connect (on_button_release_event);
9393
94 cache = new Ctk.EffectCache ();94 cache = new Ctk.EffectCache ();
95
95 add_effect (cache);96 add_effect (cache);
96 cache.update_texture_cache ();97 cache.update_texture_cache ();
97 hbox.queue_redraw.connect (() => {98 hbox.queue_redraw.connect (() => {
@@ -99,6 +100,9 @@
99 cache.update_texture_cache ();100 cache.update_texture_cache ();
100 });101 });
101102
103 if (Unity.Quirks.cache_disabled ())
104 remove_effect (cache);
105
102 END_FUNCTION ();106 END_FUNCTION ();
103 }107 }
104108
105109
=== added file 'unity-private/unity-quirks.vala'
--- unity-private/unity-quirks.vala 1970-01-01 00:00:00 +0000
+++ unity-private/unity-quirks.vala 2010-10-01 09:25:59 +0000
@@ -0,0 +1,33 @@
1/*
2 * Copyright (C) 2010 Canonical Ltd
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 3 as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authored by David Barth <david.barth@canonical.com>
17 *
18 */
19
20namespace Unity.Quirks
21{
22 public bool cache_disabled ()
23 {
24 string? cache = Environment.get_variable ("UNITY_DISABLE_CACHE");
25 return (cache != null) ? true : false;
26 }
27
28 public bool effects_disabled ()
29 {
30 string? effects = Environment.get_variable ("CLUTK_DISABLE_EFFECTS");
31 return (effects != null) ? true : false;
32 }
33}