Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-14 12:04:28 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-14 13:37:31 (GMT)
commit7f8a57e4c222e83aac98265dc37e66ba529ae4d2 (patch)
treea635224fc73551a8483b2f02666f886fb27ce98e
parentde4a186f9b221996cab96daf6a754eeb8dd5a212 (diff)
Rework how we select the Xcursor theme
Metacity reads the default theme from gsettings and we was trying to override it at lower level, causing race conditions. Now we are just setting the cursor-theme gsetting, so that metacity setup the sugar theme for us. Distributions which are shipping both GNOME and sugar should make sure to set XDG_CONFIG_HOME for either of the desktops to point to a non default location, so that the settings are not conflicting. It's necessary in this case if you don't want to get the sugar cursors in GNOME, but it seems like a sane approach in general. We are sharing several components with GNOME which are (or might in the future) be using GNOME gsettings.
-rw-r--r--bin/sugar.in2
-rwxr-xr-xsrc/jarabe/main.py17
2 files changed, 5 insertions, 14 deletions
diff --git a/bin/sugar.in b/bin/sugar.in
index 606057d..440e3b3 100644
--- a/bin/sugar.in
+++ b/bin/sugar.in
@@ -46,6 +46,4 @@ if [ -f ~/.sugar/debug ]; then
. ~/.sugar/debug
fi
-echo Xcursor.theme: sugar | xrdb -merge
-
exec python -m jarabe.main
diff --git a/src/jarabe/main.py b/src/jarabe/main.py
index 8b6cec3..3db7eca 100755
--- a/src/jarabe/main.py
+++ b/src/jarabe/main.py
@@ -37,6 +37,7 @@ sys.setdefaultencoding('utf-8')
import gettext
+from gi.repository import Gio
from gi.repository import GLib
from gi.repository import GConf
from gi.repository import Gtk
@@ -146,6 +147,9 @@ def _setup_theme():
def _start_window_manager():
global _metacity_process
+ settings = Gio.Settings.new("org.gnome.desktop.interface")
+ settings.set_string("cursor-theme", "sugar")
+
_metacity_process = subprocess.Popen(["metacity", "--no-force-fullscreen"])
screen = Wnck.Screen.get_default()
@@ -200,17 +204,6 @@ def _setup_locale():
if timezone is not None and timezone:
os.environ['TZ'] = timezone
-def _setup_mouse():
- client = GConf.Client.get_default()
- client.set_string('/apps/metacity/general/mouse_button_modifier',
- '<Super>')
-
- cursortracker.setup()
- # make sure we have the correct cursor in the intro screen
- # TODO #3204
- if subprocess.call(["xsetroot", "-cursor_name", "left_ptr"]):
- logging.warning('Can not reset cursor')
-
def _main():
GLib.threads_init()
Gdk.threads_init()
@@ -222,7 +215,6 @@ def _main():
_start_window_manager()
_setup_locale()
- _setup_mouse()
_setup_fonts()
_setup_theme()
@@ -230,6 +222,7 @@ def _main():
# even when we initially get blocked on the intro screen
GObject.idle_add(_unfreeze_dcon_cb)
+ cursortracker.setup()
sound.restore()
keyboard.setup()