diff options
author | Daniel Drake <dsd@laptop.org> | 2011-10-06 14:59:29 (GMT) |
---|---|---|
committer | Daniel Drake <dsd@laptop.org> | 2011-10-09 13:56:35 (GMT) |
commit | e899fa0fe99104c90530e1e3d3e872df44e4d615 (patch) | |
tree | f0617d378b4d1c2d65ec70e3b094f4354a942ee0 | |
parent | 0e63a7f5eea9de7133b68cb64920bd6837fc323c (diff) |
Only activate keyboard configuration if it was configured, OLPC #11175
Sugar is currently activing a new keyboard config even if the user
did not change any settings.
Avoid this by only activating the configuration if user-specified
settings are found in gconf. Also remove the default 'evdev' model
string so that gconf settings are truly blank unless the user has
selected something.
This fixes the case where keyboard settings were configured elsewhere,
but Sugar ends up throwing those away and applying its own 'blank'
settings.
The forced 'evdev' default was added in #1717:
Since we do not supply a keyboard model by default, xfree86 gets
picked up, and as a result the arrow keys, etc do not work on Xephyr.
We should use evdev instead.
However, this seems more like an evdev configuration issue, and
regardless of this, arrow keys are not working before this patch anyway.
Acked-By: Sascha Silbe <silbe@activitycentral.com>
Signed-off-by: Daniel Drake <dsd@laptop.org>
-rwxr-xr-x | bin/sugar-session | 7 | ||||
-rw-r--r-- | data/sugar.schemas.in | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/bin/sugar-session b/bin/sugar-session index a0ec14f..8ea195f 100755 --- a/bin/sugar-session +++ b/bin/sugar-session @@ -127,6 +127,7 @@ def setup_keyboard_cb(): logging.debug('STARTUP: setup_keyboard_cb') gconf_client = gconf.client_get_default() + have_config = False try: display = gtk.gdk.display_get_default() @@ -148,20 +149,24 @@ def setup_keyboard_cb(): variants_list.append(layout.split('(')[1][:-1]) if layouts_list and variants_list: + have_config = True configrec.set_layouts(layouts_list) configrec.set_variants(variants_list) model = gconf_client.get_string(\ '/desktop/sugar/peripherals/keyboard/model') if model: + have_config = True configrec.set_model(model) options = gconf_client.get_list(\ '/desktop/sugar/peripherals/keyboard/options', gconf.VALUE_STRING) if options: + have_config = True configrec.set_options(options) - configrec.activate(engine) + if have_config: + configrec.activate(engine) except Exception: logging.exception('Error during keyboard configuration') diff --git a/data/sugar.schemas.in b/data/sugar.schemas.in index b13f746..8b3e1ad 100644 --- a/data/sugar.schemas.in +++ b/data/sugar.schemas.in @@ -232,7 +232,6 @@ <applyto>/desktop/sugar/peripherals/keyboard/model</applyto> <owner>sugar</owner> <type>string</type> - <default>evdev</default> <locale name="C"> <short>Keyboard model</short> <long>The keyboard model to be used</long> |