[Sugar-devel] [PATCH sugar 19/20] Factor out setup_mouse from main

Daniel Narvaez dwnarvaez at gmail.com
Mon Dec 10 14:11:45 EST 2012


From: Daniel Narvaez <dwnarvaez at gmail.com>

Finally main is getting down to something readable.
---
 src/jarabe/main.py |   29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/src/jarabe/main.py b/src/jarabe/main.py
index 2ff06f9..c379361 100755
--- a/src/jarabe/main.py
+++ b/src/jarabe/main.py
@@ -166,6 +166,17 @@ 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()
@@ -174,25 +185,13 @@ def _main():
 
     _cleanup_temporary_files()
 
-    _setup_locale()
-
-    client = GConf.Client.get_default()
-    client.set_string('/apps/metacity/general/mouse_button_modifier',
-                      '<Super>')
+    screen.set_dcon_freeze(0)
 
+    _setup_locale()
+    _setup_mouse()
     _setup_fonts()
     _setup_theme()
 
-    # this must be added early, so that it executes and unfreezes the screen
-    # even when we initially get blocked on the intro screen
-    screen.set_dcon_freeze(0)
-
-    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')
-
     sound.restore()
 
     sys.path.append(config.ext_path)
-- 
1.7.10.4



More information about the Sugar-devel mailing list