Merge lp:~3v1n0/compiz/safer-profile-for-lowgfx into lp:compiz/0.9.13

Proposed by Marco Trevisan (Treviño) on 2016-07-14
Status: Merged
Approved by: Andrea Azzarone on 2016-07-14
Approved revision: 4072
Merged at revision: 4070
Proposed branch: lp:~3v1n0/compiz/safer-profile-for-lowgfx
Merge into: lp:compiz/0.9.13
Prerequisite: lp:~3v1n0/compiz/ccs-gsetting-safer-update
Diff against target: 342 lines (+56/-214)
9 files modified
debian/00_remove_decor_in_unity_session.py (+0/-47)
debian/00_remove_gnomecompat_in_unity_session.py (+0/-48)
debian/00_remove_obsolete_plugins_in_unity_session_v1.py (+52/-0)
debian/00_remove_scalefilter_in_unity_session.py (+0/-47)
debian/compiz-gnome.gconf-defaults (+0/-10)
debian/compiz-gnome.gsettings-override (+0/-1)
debian/compiz-gnome.migrations (+1/-3)
plugins/gnomecompat/gnomecompat.xml.in (+3/-0)
src/plugin.cpp (+0/-58)
To merge this branch: bzr merge lp:~3v1n0/compiz/safer-profile-for-lowgfx
Reviewer Review Type Date Requested Status
Andrea Azzarone 2016-07-14 Approve on 2016-07-14
PS Jenkins bot continuous-integration Pending
Review via email: mp+300052@code.launchpad.net

Commit message

migration scripts: remove unsupported plugins for all the unity profiles

To post a comment you must log in.
4070. By Marco Trevisan (Treviño) on 2016-07-14

GnomeCompat: remove unityshell support

We don't use it anymore

4071. By Marco Trevisan (Treviño) on 2016-07-14

migration scripts: remove unsupported plugins for all the unity profiles

4072. By Marco Trevisan (Treviño) on 2016-07-14

compiz-gnome.migrations: just add a script for removing plugins from unityshell

Andrea Azzarone (azzar1) wrote :

Grazie

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'debian/00_remove_decor_in_unity_session.py'
2--- debian/00_remove_decor_in_unity_session.py 2015-04-06 13:42:54 +0000
3+++ debian/00_remove_decor_in_unity_session.py 1970-01-01 00:00:00 +0000
4@@ -1,47 +0,0 @@
5-#!/usr/bin/python3
6-# -*- coding: utf-8 -*-
7-# Copyright (C) 2014-2015 Canonical
8-#
9-# Authors:
10-# Marco Trevisan <marco.trevisan@canonical.com>
11-#
12-# This program is free software; you can redistribute it and/or modify it under
13-# the terms of the GNU General Public License as published by the Free Software
14-# Foundation; version 3.
15-#
16-# This program is distributed in the hope that it will be useful, but WITHOUTa
17-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
19-# details.
20-#
21-# You should have received a copy of the GNU General Public License along with
22-# this program; if not, write to the Free Software Foundation, Inc.,
23-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24-
25-from gi.repository import Gio
26-import os,sys
27-
28-COMPIZ_SCHEMA = "org.compiz"
29-COMPIZ_CORE_PATH = "/org/compiz/profiles/unity/plugins/core/"
30-
31-if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
32- print("No compiz schemas found, no migration needed")
33- sys.exit(0)
34-
35-core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=COMPIZ_CORE_PATH)
36-active_plugins = core_settings.get_strv("active-plugins")
37-
38-if not "decor" in active_plugins:
39- print("No decor plugin active, no migration needed")
40- sys.exit(0)
41-
42-try:
43- active_plugins.remove("decor")
44-except ValueError:
45- pass
46-
47-# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
48-# gsettings.set_strv("active-plugins", active_plugins)
49-from subprocess import Popen, PIPE, STDOUT
50-p = Popen(("dconf load "+COMPIZ_CORE_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
51-p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins),'utf-8'))
52
53=== removed file 'debian/00_remove_gnomecompat_in_unity_session.py'
54--- debian/00_remove_gnomecompat_in_unity_session.py 2015-04-06 13:42:54 +0000
55+++ debian/00_remove_gnomecompat_in_unity_session.py 1970-01-01 00:00:00 +0000
56@@ -1,48 +0,0 @@
57-#!/usr/bin/python3
58-# -*- coding: utf-8 -*-
59-# Copyright (C) 2014-2015 Canonical
60-#
61-# Authors:
62-# Marco Trevisan <marco.trevisan@canonical.com>
63-# William Hua <william.hua@canonical.com>
64-#
65-# This program is free software; you can redistribute it and/or modify it under
66-# the terms of the GNU General Public License as published by the Free Software
67-# Foundation; version 3.
68-#
69-# This program is distributed in the hope that it will be useful, but WITHOUTa
70-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
71-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
72-# details.
73-#
74-# You should have received a copy of the GNU General Public License along with
75-# this program; if not, write to the Free Software Foundation, Inc.,
76-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
77-
78-from gi.repository import Gio
79-import os,sys
80-
81-COMPIZ_SCHEMA = "org.compiz"
82-COMPIZ_CORE_PATH = "/org/compiz/profiles/unity/plugins/core/"
83-
84-if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
85- print("No compiz schemas found, no migration needed")
86- sys.exit(0)
87-
88-core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=COMPIZ_CORE_PATH)
89-active_plugins = core_settings.get_strv("active-plugins")
90-
91-if not "gnomecompat" in active_plugins:
92- print("No gnomecompat plugin active, no migration needed")
93- sys.exit(0)
94-
95-try:
96- active_plugins.remove("gnomecompat")
97-except ValueError:
98- pass
99-
100-# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
101-# gsettings.set_strv("active-plugins", active_plugins)
102-from subprocess import Popen, PIPE, STDOUT
103-p = Popen(("dconf load "+COMPIZ_CORE_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
104-p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
105
106=== added file 'debian/00_remove_obsolete_plugins_in_unity_session_v1.py'
107--- debian/00_remove_obsolete_plugins_in_unity_session_v1.py 1970-01-01 00:00:00 +0000
108+++ debian/00_remove_obsolete_plugins_in_unity_session_v1.py 2016-07-14 15:49:11 +0000
109@@ -0,0 +1,52 @@
110+#!/usr/bin/python3
111+# -*- coding: utf-8 -*-
112+# Copyright (C) 2016 Canonical
113+#
114+# Authors:
115+# Marco Trevisan <marco.trevisan@canonical.com>
116+#
117+# This program is free software; you can redistribute it and/or modify it under
118+# the terms of the GNU General Public License as published by the Free Software
119+# Foundation; version 3.
120+#
121+# This program is distributed in the hope that it will be useful, but WITHOUTa
122+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
123+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
124+# details.
125+#
126+# You should have received a copy of the GNU General Public License along with
127+# this program; if not, write to the Free Software Foundation, Inc.,
128+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
129+
130+from gi.repository import Gio
131+import os,sys
132+
133+COMPIZ_SCHEMA = "org.compiz"
134+COMPIZ_CORE_PATH = "/org/compiz/profiles/{}/plugins/core/"
135+UNITY_PROFILES = ["unity", "unity-lowgfx"]
136+OBSOLETE_PLUGINS = ["decor", "gnomecompat", "scalefilter"]
137+
138+if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
139+ print("No compiz schemas found, no migration needed")
140+ sys.exit(0)
141+
142+for profile in UNITY_PROFILES:
143+ core_profile_path = COMPIZ_CORE_PATH.format(profile)
144+ core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=core_profile_path)
145+ active_plugins = core_settings.get_strv("active-plugins")
146+
147+ for plugin in OBSOLETE_PLUGINS:
148+ if not plugin in active_plugins:
149+ print("No '{}' plugin active in '{}' profile, no migration needed".format(plugin, profile))
150+ continue
151+
152+ try:
153+ active_plugins.remove(plugin)
154+ except ValueError:
155+ pass
156+
157+ # gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
158+ # gsettings.set_strv("active-plugins", active_plugins)
159+ from subprocess import Popen, PIPE, STDOUT
160+ p = Popen(("dconf load "+core_profile_path).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
161+ p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
162
163=== removed file 'debian/00_remove_scalefilter_in_unity_session.py'
164--- debian/00_remove_scalefilter_in_unity_session.py 2015-04-06 13:42:54 +0000
165+++ debian/00_remove_scalefilter_in_unity_session.py 1970-01-01 00:00:00 +0000
166@@ -1,47 +0,0 @@
167-#!/usr/bin/python3
168-# -*- coding: utf-8 -*-
169-# Copyright (C) 2014-2015 Canonical
170-#
171-# Authors:
172-# Marco Trevisan <marco.trevisan@canonical.com>
173-#
174-# This program is free software; you can redistribute it and/or modify it under
175-# the terms of the GNU General Public License as published by the Free Software
176-# Foundation; version 3.
177-#
178-# This program is distributed in the hope that it will be useful, but WITHOUTa
179-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
180-# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
181-# details.
182-#
183-# You should have received a copy of the GNU General Public License along with
184-# this program; if not, write to the Free Software Foundation, Inc.,
185-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
186-
187-from gi.repository import Gio
188-import os,sys
189-
190-COMPIZ_SCHEMA = "org.compiz"
191-COMPIZ_CORE_PATH = "/org/compiz/profiles/unity/plugins/core/"
192-
193-if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
194- print("No compiz schemas found, no migration needed")
195- sys.exit(0)
196-
197-core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=COMPIZ_CORE_PATH)
198-active_plugins = core_settings.get_strv("active-plugins")
199-
200-if not "scalefilter" in active_plugins:
201- print("No decor scalefilter active, no migration needed")
202- sys.exit(0)
203-
204-try:
205- active_plugins.remove("scalefilter")
206-except ValueError:
207- pass
208-
209-# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
210-# gsettings.set_strv("active-plugins", active_plugins)
211-from subprocess import Popen, PIPE, STDOUT
212-p = Popen(("dconf load "+COMPIZ_CORE_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
213-p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
214
215=== removed file 'debian/compiz-gnome.gconf-defaults'
216--- debian/compiz-gnome.gconf-defaults 2014-03-11 14:04:52 +0000
217+++ debian/compiz-gnome.gconf-defaults 1970-01-01 00:00:00 +0000
218@@ -1,10 +0,0 @@
219-/apps/compiz-1/plugins/move/screen0/options/constrain_y true
220-/apps/compiz-1/general/screen0/options/hsize 2
221-/apps/compiz-1/general/screen0/options/vsize 2
222-/apps/gwd/blur_type all
223-/apps/gwd/metacity_theme_opacity 1.0
224-/apps/gwd/metacity_theme_shade_opacity true
225-/apps/compizconfig-1/profiles/unity/general/screen0/options/active_plugins [core,composite,opengl,compiztoolbox,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,unitymtgrabhandles,workarounds,scale,expo,ezoom,unityshell]
226-/apps/compizconfig-1/profiles/unity/plugins/gnomecompat/screen0/options/main_menu_key ""
227-/apps/compizconfig-1/profiles/unity/plugins/gnomecompat/screen0/options/run_key ""
228-/apps/compizconfig-1/profiles/Default/general/screen0/options/active_plugins [core,composite,opengl,compiztoolbox,decor,vpswitch,snap,mousepoll,resize,place,move,wall,grid,regex,imgpng,session,gnomecompat,animation,fade,workarounds,scale,expo,ezoom]
229
230=== modified file 'debian/compiz-gnome.gsettings-override'
231--- debian/compiz-gnome.gsettings-override 2015-07-25 18:35:50 +0000
232+++ debian/compiz-gnome.gsettings-override 2016-07-14 15:49:11 +0000
233@@ -10,4 +10,3 @@
234
235 [org.compiz.animation]
236 unminimize-effects=['animation:Glide 2']
237-
238
239=== modified file 'debian/compiz-gnome.migrations'
240--- debian/compiz-gnome.migrations 2015-02-19 15:57:24 +0000
241+++ debian/compiz-gnome.migrations 2016-07-14 15:49:11 +0000
242@@ -1,3 +1,1 @@
243-debian/00_remove_decor_in_unity_session.py
244-debian/00_remove_scalefilter_in_unity_session.py
245-debian/00_remove_gnomecompat_in_unity_session.py
246+debian/00_remove_obsolete_plugins_in_unity_session_v1.py
247
248=== modified file 'plugins/gnomecompat/gnomecompat.xml.in'
249--- plugins/gnomecompat/gnomecompat.xml.in 2015-10-26 17:15:43 +0000
250+++ plugins/gnomecompat/gnomecompat.xml.in 2016-07-14 15:49:11 +0000
251@@ -11,6 +11,9 @@
252 <plugin>opengl</plugin>
253 <plugin>decor</plugin>
254 </relation>
255+ <conflict>
256+ <plugin>unityshell</plugin>
257+ </conflict>
258 </deps>
259 <options>
260 <option name="main_menu_key" type="key">
261
262=== modified file 'src/plugin.cpp'
263--- src/plugin.cpp 2015-10-26 17:15:43 +0000
264+++ src/plugin.cpp 2016-07-14 15:49:11 +0000
265@@ -132,60 +132,6 @@
266 }
267
268 static bool
269-setOpenGLPluginEnvironment ()
270-{
271- /*
272- * Check if the hardware is adequate for Unity and if not, use LLVMpipe.
273- * Unfortunately the design of Mesa requires that this be done before
274- * libGL is loaded, which means before the opengl plugin is loaded.
275- */
276- bool toggledLLVM = false;
277-
278- if (!getenv ("LIBGL_ALWAYS_SOFTWARE"))
279- {
280- const char *profile = getenv ("COMPIZ_CONFIG_PROFILE");
281- if (profile && strcmp (profile, "ubuntu") == 0)
282- {
283- int result = system ("/usr/lib/nux/unity_support_test");
284- int status = WEXITSTATUS (result);
285- compLogMessage ("core", CompLogLevelInfo,
286- "Unity is %s",
287- status == 0 ? "fully supported by your hardware." :
288- status == 127 ? "undetectable" :
289- "not supported by your hardware. "
290- "Enabling software rendering instead (slow).");
291- if (status > 0 && status < 127)
292- {
293- setenv ("LIBGL_ALWAYS_SOFTWARE", "1", 1);
294- toggledLLVM = true;
295- }
296- }
297- }
298-
299- return toggledLLVM;
300-}
301-
302-static void
303-unsetUnityshellPluginEnvironment ()
304-{
305- unsetenv ("LIBGL_ALWAYS_SOFTWARE");
306-}
307-
308-static void
309-setPluginEnvironment (const char *name)
310-{
311- if (strcmp (name, "opengl") == 0)
312- setOpenGLPluginEnvironment ();
313-}
314-
315-static void
316-unsetPluginEnvironment (const char *name)
317-{
318- if (strcmp (name, "unityshell") == 0)
319- unsetUnityshellPluginEnvironment ();
320-}
321-
322-static bool
323 dlloaderLoadPlugin (CompPlugin *p,
324 const char *path,
325 const char *name)
326@@ -197,8 +143,6 @@
327 if (cloaderLoadPlugin (p, path, name))
328 return true;
329
330- setPluginEnvironment (name);
331-
332 if (path)
333 {
334 file = path;
335@@ -269,8 +213,6 @@
336 if (!loaded && dlhand)
337 dlclose (dlhand);
338
339- unsetPluginEnvironment (name);
340-
341 return loaded;
342 }
343

Subscribers

People subscribed via source and target branches