gnome-settings-daemon r333 - in trunk: . plugins/keyboard
- From: jensg svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-settings-daemon r333 - in trunk: . plugins/keyboard
- Date: Mon, 5 May 2008 19:40:31 +0100 (BST)
Author: jensg
Date: Mon May 5 18:40:31 2008
New Revision: 333
URL: http://svn.gnome.org/viewvc/gnome-settings-daemon?rev=333&view=rev
Log:
2008-05-02 Jens Granseuer <jensgr gmx net>
Based on a patch by: Matthias Clasen <mclasen redhat com>
* plugins/keyboard/gsd-keyboard-xkb.c: (apply_xkb_settings),
(gsd_keyboard_xkb_init): if the user set a keyboard layout from
the login screen, try to keep that setting (bug #531589)
Modified:
trunk/ChangeLog
trunk/plugins/keyboard/gsd-keyboard-xkb.c
Modified: trunk/plugins/keyboard/gsd-keyboard-xkb.c
==============================================================================
--- trunk/plugins/keyboard/gsd-keyboard-xkb.c (original)
+++ trunk/plugins/keyboard/gsd-keyboard-xkb.c Mon May 5 18:40:31 2008
@@ -57,6 +57,8 @@
static const char KNOWN_FILES_KEY[] =
"/desktop/gnome/peripherals/keyboard/general/known_file_list";
+static char *gdm_keyboard_layout = NULL;
+
#define noGSDKX
#ifdef GSDKX
@@ -138,7 +140,7 @@
static void
apply_xkb_settings (void)
{
- GConfClient *conf_client;
+ GConfClient *conf_client;
GkbdKeyboardConfig current_sys_kbd_config;
if (!inited_ok)
@@ -155,6 +157,30 @@
gkbd_keyboard_config_load_from_x_current (¤t_sys_kbd_config,
NULL);
+
+ /* With GDM the user can already set a layout from the login
+ * screen. Try to keep that setting */
+ if (gdm_keyboard_layout != NULL) {
+ if (current_kbd_config.layouts_variants == NULL) {
+ current_kbd_config.layouts_variants = g_slist_append (NULL, gdm_keyboard_layout);
+ gconf_client_set_list (conf_client,
+ GKBD_KEYBOARD_CONFIG_KEY_LAYOUTS,
+ GCONF_VALUE_STRING,
+ current_kbd_config.layouts_variants,
+ NULL);
+ } else {
+ GSList *l;
+ int i;
+ for (i = 0, l = current_kbd_config.layouts_variants; l; i++, l = l->next) {
+ if (strcmp (gdm_keyboard_layout, l->data) == 0) {
+ xkl_engine_lock_group (current_config.engine, i);
+ break;
+ }
+ }
+ }
+ gdm_keyboard_layout = NULL;
+ }
+
/* Activate - only if different! */
if (!gkbd_keyboard_config_equals
(¤t_kbd_config, ¤t_sys_kbd_config)) {
@@ -302,10 +328,12 @@
logfile = fopen ("/tmp/gsdkx.log", "a");
xkl_set_log_appender (gsd_keyboard_log_appender);
#endif
-
xkl_engine = xkl_engine_get_instance (GDK_DISPLAY ());
if (xkl_engine) {
inited_ok = TRUE;
+
+ gdm_keyboard_layout = g_getenv ("GDM_KEYBOARD_LAYOUT");
+
gkbd_desktop_config_init (¤t_config,
client,
xkl_engine);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]