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

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
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 Approve
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)

GnomeCompat: remove unityshell support

We don't use it anymore

4071. By Marco Trevisan (Treviño)

migration scripts: remove unsupported plugins for all the unity profiles

4072. By Marco Trevisan (Treviño)

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

Revision history for this message
Andrea Azzarone (azzar1) wrote :

Grazie

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'debian/00_remove_decor_in_unity_session.py'
--- debian/00_remove_decor_in_unity_session.py 2015-04-06 13:42:54 +0000
+++ debian/00_remove_decor_in_unity_session.py 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1#!/usr/bin/python3
2# -*- coding: utf-8 -*-
3# Copyright (C) 2014-2015 Canonical
4#
5# Authors:
6# Marco Trevisan <marco.trevisan@canonical.com>
7#
8# This program is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free Software
10# Foundation; version 3.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUTa
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15# details.
16#
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21from gi.repository import Gio
22import os,sys
23
24COMPIZ_SCHEMA = "org.compiz"
25COMPIZ_CORE_PATH = "/org/compiz/profiles/unity/plugins/core/"
26
27if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
28 print("No compiz schemas found, no migration needed")
29 sys.exit(0)
30
31core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=COMPIZ_CORE_PATH)
32active_plugins = core_settings.get_strv("active-plugins")
33
34if not "decor" in active_plugins:
35 print("No decor plugin active, no migration needed")
36 sys.exit(0)
37
38try:
39 active_plugins.remove("decor")
40except ValueError:
41 pass
42
43# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
44# gsettings.set_strv("active-plugins", active_plugins)
45from subprocess import Popen, PIPE, STDOUT
46p = Popen(("dconf load "+COMPIZ_CORE_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
47p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins),'utf-8'))
480
=== removed file 'debian/00_remove_gnomecompat_in_unity_session.py'
--- debian/00_remove_gnomecompat_in_unity_session.py 2015-04-06 13:42:54 +0000
+++ debian/00_remove_gnomecompat_in_unity_session.py 1970-01-01 00:00:00 +0000
@@ -1,48 +0,0 @@
1#!/usr/bin/python3
2# -*- coding: utf-8 -*-
3# Copyright (C) 2014-2015 Canonical
4#
5# Authors:
6# Marco Trevisan <marco.trevisan@canonical.com>
7# William Hua <william.hua@canonical.com>
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; version 3.
12#
13# This program is distributed in the hope that it will be useful, but WITHOUTa
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16# details.
17#
18# You should have received a copy of the GNU General Public License along with
19# this program; if not, write to the Free Software Foundation, Inc.,
20# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
22from gi.repository import Gio
23import os,sys
24
25COMPIZ_SCHEMA = "org.compiz"
26COMPIZ_CORE_PATH = "/org/compiz/profiles/unity/plugins/core/"
27
28if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
29 print("No compiz schemas found, no migration needed")
30 sys.exit(0)
31
32core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=COMPIZ_CORE_PATH)
33active_plugins = core_settings.get_strv("active-plugins")
34
35if not "gnomecompat" in active_plugins:
36 print("No gnomecompat plugin active, no migration needed")
37 sys.exit(0)
38
39try:
40 active_plugins.remove("gnomecompat")
41except ValueError:
42 pass
43
44# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
45# gsettings.set_strv("active-plugins", active_plugins)
46from subprocess import Popen, PIPE, STDOUT
47p = Popen(("dconf load "+COMPIZ_CORE_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
48p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
490
=== added file 'debian/00_remove_obsolete_plugins_in_unity_session_v1.py'
--- debian/00_remove_obsolete_plugins_in_unity_session_v1.py 1970-01-01 00:00:00 +0000
+++ debian/00_remove_obsolete_plugins_in_unity_session_v1.py 2016-07-14 15:49:11 +0000
@@ -0,0 +1,52 @@
1#!/usr/bin/python3
2# -*- coding: utf-8 -*-
3# Copyright (C) 2016 Canonical
4#
5# Authors:
6# Marco Trevisan <marco.trevisan@canonical.com>
7#
8# This program is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free Software
10# Foundation; version 3.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUTa
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15# details.
16#
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21from gi.repository import Gio
22import os,sys
23
24COMPIZ_SCHEMA = "org.compiz"
25COMPIZ_CORE_PATH = "/org/compiz/profiles/{}/plugins/core/"
26UNITY_PROFILES = ["unity", "unity-lowgfx"]
27OBSOLETE_PLUGINS = ["decor", "gnomecompat", "scalefilter"]
28
29if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
30 print("No compiz schemas found, no migration needed")
31 sys.exit(0)
32
33for profile in UNITY_PROFILES:
34 core_profile_path = COMPIZ_CORE_PATH.format(profile)
35 core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=core_profile_path)
36 active_plugins = core_settings.get_strv("active-plugins")
37
38 for plugin in OBSOLETE_PLUGINS:
39 if not plugin in active_plugins:
40 print("No '{}' plugin active in '{}' profile, no migration needed".format(plugin, profile))
41 continue
42
43 try:
44 active_plugins.remove(plugin)
45 except ValueError:
46 pass
47
48 # gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
49 # gsettings.set_strv("active-plugins", active_plugins)
50 from subprocess import Popen, PIPE, STDOUT
51 p = Popen(("dconf load "+core_profile_path).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
52 p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
053
=== removed file 'debian/00_remove_scalefilter_in_unity_session.py'
--- debian/00_remove_scalefilter_in_unity_session.py 2015-04-06 13:42:54 +0000
+++ debian/00_remove_scalefilter_in_unity_session.py 1970-01-01 00:00:00 +0000
@@ -1,47 +0,0 @@
1#!/usr/bin/python3
2# -*- coding: utf-8 -*-
3# Copyright (C) 2014-2015 Canonical
4#
5# Authors:
6# Marco Trevisan <marco.trevisan@canonical.com>
7#
8# This program is free software; you can redistribute it and/or modify it under
9# the terms of the GNU General Public License as published by the Free Software
10# Foundation; version 3.
11#
12# This program is distributed in the hope that it will be useful, but WITHOUTa
13# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15# details.
16#
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc.,
19# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21from gi.repository import Gio
22import os,sys
23
24COMPIZ_SCHEMA = "org.compiz"
25COMPIZ_CORE_PATH = "/org/compiz/profiles/unity/plugins/core/"
26
27if COMPIZ_SCHEMA not in Gio.Settings.list_schemas():
28 print("No compiz schemas found, no migration needed")
29 sys.exit(0)
30
31core_settings = Gio.Settings(schema=COMPIZ_SCHEMA+".core", path=COMPIZ_CORE_PATH)
32active_plugins = core_settings.get_strv("active-plugins")
33
34if not "scalefilter" in active_plugins:
35 print("No decor scalefilter active, no migration needed")
36 sys.exit(0)
37
38try:
39 active_plugins.remove("scalefilter")
40except ValueError:
41 pass
42
43# gsettings doesn't work directly, the key is somewhat reverted. Work one level under then: dconf!
44# gsettings.set_strv("active-plugins", active_plugins)
45from subprocess import Popen, PIPE, STDOUT
46p = Popen(("dconf load "+COMPIZ_CORE_PATH).split(), stdout=PIPE, stdin=PIPE, stderr=STDOUT)
47p.communicate(input=bytes("[/]\nactive-plugins={}".format(active_plugins), 'utf-8'))
480
=== removed file 'debian/compiz-gnome.gconf-defaults'
--- debian/compiz-gnome.gconf-defaults 2014-03-11 14:04:52 +0000
+++ debian/compiz-gnome.gconf-defaults 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1/apps/compiz-1/plugins/move/screen0/options/constrain_y true
2/apps/compiz-1/general/screen0/options/hsize 2
3/apps/compiz-1/general/screen0/options/vsize 2
4/apps/gwd/blur_type all
5/apps/gwd/metacity_theme_opacity 1.0
6/apps/gwd/metacity_theme_shade_opacity true
7/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]
8/apps/compizconfig-1/profiles/unity/plugins/gnomecompat/screen0/options/main_menu_key ""
9/apps/compizconfig-1/profiles/unity/plugins/gnomecompat/screen0/options/run_key ""
10/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]
110
=== modified file 'debian/compiz-gnome.gsettings-override'
--- debian/compiz-gnome.gsettings-override 2015-07-25 18:35:50 +0000
+++ debian/compiz-gnome.gsettings-override 2016-07-14 15:49:11 +0000
@@ -10,4 +10,3 @@
1010
11[org.compiz.animation]11[org.compiz.animation]
12unminimize-effects=['animation:Glide 2']12unminimize-effects=['animation:Glide 2']
13
1413
=== modified file 'debian/compiz-gnome.migrations'
--- debian/compiz-gnome.migrations 2015-02-19 15:57:24 +0000
+++ debian/compiz-gnome.migrations 2016-07-14 15:49:11 +0000
@@ -1,3 +1,1 @@
1debian/00_remove_decor_in_unity_session.py1debian/00_remove_obsolete_plugins_in_unity_session_v1.py
2debian/00_remove_scalefilter_in_unity_session.py
3debian/00_remove_gnomecompat_in_unity_session.py
42
=== modified file 'plugins/gnomecompat/gnomecompat.xml.in'
--- plugins/gnomecompat/gnomecompat.xml.in 2015-10-26 17:15:43 +0000
+++ plugins/gnomecompat/gnomecompat.xml.in 2016-07-14 15:49:11 +0000
@@ -11,6 +11,9 @@
11 <plugin>opengl</plugin>11 <plugin>opengl</plugin>
12 <plugin>decor</plugin>12 <plugin>decor</plugin>
13 </relation>13 </relation>
14 <conflict>
15 <plugin>unityshell</plugin>
16 </conflict>
14 </deps>17 </deps>
15 <options>18 <options>
16 <option name="main_menu_key" type="key">19 <option name="main_menu_key" type="key">
1720
=== modified file 'src/plugin.cpp'
--- src/plugin.cpp 2015-10-26 17:15:43 +0000
+++ src/plugin.cpp 2016-07-14 15:49:11 +0000
@@ -132,60 +132,6 @@
132}132}
133133
134static bool134static bool
135setOpenGLPluginEnvironment ()
136{
137 /*
138 * Check if the hardware is adequate for Unity and if not, use LLVMpipe.
139 * Unfortunately the design of Mesa requires that this be done before
140 * libGL is loaded, which means before the opengl plugin is loaded.
141 */
142 bool toggledLLVM = false;
143
144 if (!getenv ("LIBGL_ALWAYS_SOFTWARE"))
145 {
146 const char *profile = getenv ("COMPIZ_CONFIG_PROFILE");
147 if (profile && strcmp (profile, "ubuntu") == 0)
148 {
149 int result = system ("/usr/lib/nux/unity_support_test");
150 int status = WEXITSTATUS (result);
151 compLogMessage ("core", CompLogLevelInfo,
152 "Unity is %s",
153 status == 0 ? "fully supported by your hardware." :
154 status == 127 ? "undetectable" :
155 "not supported by your hardware. "
156 "Enabling software rendering instead (slow).");
157 if (status > 0 && status < 127)
158 {
159 setenv ("LIBGL_ALWAYS_SOFTWARE", "1", 1);
160 toggledLLVM = true;
161 }
162 }
163 }
164
165 return toggledLLVM;
166}
167
168static void
169unsetUnityshellPluginEnvironment ()
170{
171 unsetenv ("LIBGL_ALWAYS_SOFTWARE");
172}
173
174static void
175setPluginEnvironment (const char *name)
176{
177 if (strcmp (name, "opengl") == 0)
178 setOpenGLPluginEnvironment ();
179}
180
181static void
182unsetPluginEnvironment (const char *name)
183{
184 if (strcmp (name, "unityshell") == 0)
185 unsetUnityshellPluginEnvironment ();
186}
187
188static bool
189dlloaderLoadPlugin (CompPlugin *p,135dlloaderLoadPlugin (CompPlugin *p,
190 const char *path,136 const char *path,
191 const char *name)137 const char *name)
@@ -197,8 +143,6 @@
197 if (cloaderLoadPlugin (p, path, name))143 if (cloaderLoadPlugin (p, path, name))
198 return true;144 return true;
199145
200 setPluginEnvironment (name);
201
202 if (path)146 if (path)
203 {147 {
204 file = path;148 file = path;
@@ -269,8 +213,6 @@
269 if (!loaded && dlhand)213 if (!loaded && dlhand)
270 dlclose (dlhand);214 dlclose (dlhand);
271215
272 unsetPluginEnvironment (name);
273
274 return loaded;216 return loaded;
275}217}
276218

Subscribers

People subscribed via source and target branches