Merge lp:~didrocks/unity/unity-reset-removal into lp:unity

Proposed by Didier Roche on 2012-09-06
Status: Merged
Approved by: Michal Hruby on 2012-09-06
Approved revision: 2658
Merged at revision: 2665
Proposed branch: lp:~didrocks/unity/unity-reset-removal
Merge into: lp:unity
Diff against target: 77 lines (+0/-47)
1 file modified
tools/unity.cmake (+0/-47)
To merge this branch: bzr merge lp:~didrocks/unity/unity-reset-removal
Reviewer Review Type Date Requested Status
Michal Hruby (community) 2012-09-06 Approve on 2012-09-06
jenkins continuous-integration Pending
Review via email: mp+123112@code.launchpad.net

Commit Message

remove unity --reset, it's not anymore really needed now that we are in
stable days of unity and we moved to gsettings

Description of the Change

remove unity --reset, it's not anymore really needed now that we are in
stable days of unity and we moved to gsettings

To post a comment you must log in.
Michal Hruby (mhr3) wrote :

Looks good. +1

review: Approve
Omer Akram (om26er) wrote :

*Its still needed*. unity --reset have been proved to fix a lot of issues in different bug reports. In many cases people end up ruining their config and we ask them to run unity --reset which fixes issues for them.

Didier Roche (didrocks) wrote :

@om26er, I think the release team won't be against a FFe for a gsettings version which can stop compiz (don't switch to metacity as it's not installed anymore), reset the keys, and restart it again. You're welcome to contribute (but I guess those will need tests now)

But let's remove (now broken) code first as it's useless.

Jeremy Bicha (jbicha) wrote :

I believe dconf reset -f /org/compiz/ basically duplicates what unity --reset would have done.

You can run dconf dump /org/compiz/ first to see what custom Compiz settings you have.

Didier Roche (didrocks) wrote :

Indeed Jeremy, the trick (and that's why we switched to metacity while we were resetting the keys) is that compiz doesn't really like when we change a bunch amount of keys while running.

So, someone has to stop compiz, ensure it's not autorestarted by gnome-session, reset the keys, and restart compiz. As we don't have metacity anymore to tell to gnome-session "we already have a windowmanager", that will become a little bit more tricky…

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tools/unity.cmake'
2--- tools/unity.cmake 2012-07-04 02:37:23 +0000
3+++ tools/unity.cmake 2012-09-06 16:04:42 +0000
4@@ -18,7 +18,6 @@
5 # this program; if not, write to the Free Software Foundation, Inc.,
6 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7
8-import gconf
9 import glib
10 import glob
11 from optparse import OptionParser
12@@ -64,47 +63,6 @@
13 print "WARNING: no DISPLAY variable set, setting it to :0"
14 os.environ['DISPLAY'] = ':0'
15
16-def reset_unity_compiz_profile ():
17- '''reset the compiz/unity profile to a vanilla one'''
18-
19- client = gconf.client_get_default()
20-
21- if not client:
22- print "WARNING: no gconf client found. No reset will be done"
23- return
24-
25- # get current compiz profile to know if we need to switch or not
26- # as compiz is setting that as a default key schema each time you
27- # change the profile, the key isn't straightforward to get and set
28- # as compiz set a new schema instead of a value..
29- try:
30- current_profile_schema = client.get_schema("/apps/compizconfig-1/current_profile")
31- except (glib.GError, AttributeError), e:
32- print "WARNING: environment is incorrect: %s\nDid you just try to reset in a tty?" % e
33- return
34-
35- # default value to not force reset if current_profile is unset
36- if not current_profile_schema:
37- print "WARNING: no current gconf profile set, assuming unity"
38- current_profile_str = 'unity'
39- current_profile_gconfvalue = None
40- else:
41- current_profile_gconfvalue = current_profile_schema.get_default_value()
42- current_profile_str = current_profile_gconfvalue.get_string()
43-
44- if current_profile_str == 'unity':
45- print "WARNING: Unity currently default profile, so switching to metacity while resetting the values"
46- subprocess.Popen(["metacity", "--replace"]) #TODO: check if compiz is indeed running
47- # wait for compiz to stop
48- time.sleep(2)
49- if current_profile_gconfvalue:
50- current_profile_gconfvalue.set_string('fooo')
51- current_profile_schema.set_default_value(current_profile_gconfvalue)
52- client.set_schema("/apps/compizconfig-1/current_profile", current_profile_schema)
53- # the python binding doesn't recursive-unset right
54- subprocess.Popen(["gconftool-2", "--recursive-unset", "/apps/compiz-1"]).communicate()
55- subprocess.Popen(["gconftool-2", "--recursive-unset", "/apps/compizconfig-1/profiles/unity"]).communicate()
56-
57 def reset_launcher_icons ():
58 '''Reset the default launcher icon and restart it.'''
59 subprocess.Popen(["gsettings", "reset" ,"com.canonical.Unity.Launcher" , "favorites"])
60@@ -203,8 +161,6 @@
61 help="Store log under filename.")
62 parser.add_option("--replace", action="store_true",
63 help="Run unity /!\ This is for compatibility with other desktop interfaces and acts the same as running unity without --replace")
64- parser.add_option("--reset", action="store_true",
65- help="Reset the unity profile in compiz and restart it.")
66 parser.add_option("--reset-icons", action="store_true",
67 help="Reset the default launcher icon.")
68 parser.add_option("-v", "--verbose", action="store_true",
69@@ -216,9 +172,6 @@
70 if options.distro:
71 sys.exit(reset_to_distro())
72
73- if options.reset:
74- reset_unity_compiz_profile ()
75-
76 if options.reset_icons:
77 reset_launcher_icons ()
78