After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 599273 - gdm doesn't reread system language settings when they change
gdm doesn't reread system language settings when they change
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2009-10-22 09:24 UTC by Takao Fujiwara
Modified: 2009-12-21 18:34 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for Makefile.am, gdm-display.c, gdm.in (1.94 KB, patch)
2009-10-22 09:24 UTC, Takao Fujiwara
reviewed Details | Review
Patch for gdm.in, gdm-slave-proxy.c (4.09 KB, patch)
2009-10-28 09:59 UTC, Takao Fujiwara
none Details | Review
Patch for configure.in, gdm.in, gdm-slave-proxy.c (4.43 KB, patch)
2009-10-30 01:19 UTC, Takao Fujiwara
reviewed Details | Review
Patch for configure.in, gdm.in, gdm-slave-proxy.c (4.23 KB, patch)
2009-11-02 09:22 UTC, Takao Fujiwara
none Details | Review
Patch for configure.in, gdm.in, gdm-welcome-session.c (4.85 KB, patch)
2009-11-04 10:38 UTC, Takao Fujiwara
committed Details | Review

Description Takao Fujiwara 2009-10-22 09:24:24 UTC
Created attachment 146023 [details] [review]
Patch for Makefile.am, gdm-display.c, gdm.in

If we modify /etc/sysconfig/i18n with system-config-language, It's better to
change the GDM system locale without rebooting the system.

We fixed it in GNOME 2.20 (384603).
I think it's good to port the fix in trunk.

Now I think using a script might be an easy implementation to load the system
file.

gdm-binary restarts gdm-simple-slave so if we load the LANG value before the
slave is invoked, greeter can show the latest LANG.
Comment 1 Ray Strode [halfline] 2009-10-23 01:16:52 UTC
Review of attachment 146023 [details] [review]:

I'm not a fan of the script thing.  In 2.20 we just parsed the file directly I think.  Maybe you could just crib that code?

::: gdm-2.26.1/daemon/Makefile.am.orig
@@ +16,3 @@
+    do
+      export $l
+    done

This is a little clumbsy. I think I'd rather see either a white list of allowed variables for export or set -a.

@@ +39,3 @@
+*)
+  exec @sbindir@/gdm-binary "$@"
+  ;;

This is a little strange, I think i'd rather a separate wrapper script over reusing the gdm script. But honestly I'd rather no script at all.
Comment 2 Takao Fujiwara 2009-10-28 09:59:04 UTC
Created attachment 146413 [details] [review]
Patch for gdm.in, gdm-slave-proxy.c

> I'm not a fan of the script thing.  In 2.20 we just parsed the file directly I
think.  Maybe you could just crib that code?

OK, I moved the patch from 2.20.
We don't have to call setlocale() since setlocale() will be called by the forked applications.
The previous bonobo had a LC_MESSAGES issue but it's fixed at present so probably it's better to remove LC_MESSAGES in gdm.in.
Comment 3 Takao Fujiwara 2009-10-30 01:19:15 UTC
Created attachment 146540 [details] [review]
Patch for configure.in, gdm.in, gdm-slave-proxy.c

Revised the patch to make sure match_info = NULL.

Probably $(sysconfdir) is better than ${sysconfdir} since it's quoted by the single quotes and used in Makefile.
Comment 4 Ray Strode [halfline] 2009-10-30 14:21:44 UTC
Review of attachment 146540 [details] [review]:

::: gdm/configure.ac.orig
@@ +117,3 @@
+                g_unsetenv ("LC_MESSAGES");
+                return;
+        }

What's the point of this?  I'd just drop the GDM_LANG stuff.

@@ +122,3 @@
+
+        if (!g_file_test (config_file, G_FILE_TEST_EXISTS)) {
+                g_warning ("Cannot access '%s'", config_file);

no need for a warning here

@@ +130,3 @@
+                g_warning ("Failed to parse '%s': %s",
+                           config_file,
+                           (error && error->message) ? error->message : "(null)");

should probably be g_debug not g_warning.  It's not a bug if the file doesn't exist.

@@ +171,3 @@
+                if (!g_match_info_matches (match_info))
+                        goto next_line;
+

need braces around hte if statements to match the coding style

@@ +178,3 @@
+                        g_setenv (key, value, TRUE);
+                else if (key && *key)
+                        g_unsetenv (key);

here too

@@ +227,3 @@
 spawn_child_setup (SpawnChildData *data)
 {
+#ifdef LANG_CONFIG_FILE

don't think we need (or want) an #ifdef here.
Comment 5 Takao Fujiwara 2009-11-02 09:22:10 UTC
Created attachment 146730 [details] [review]
Patch for configure.in, gdm.in, gdm-slave-proxy.c

(In reply to comment #4)
> What's the point of this?  I'd just drop the GDM_LANG stuff.

In GDM 2.20, GDM_LANG was used for the system LANG against the user LANG.
GDM 2.20 had a menu item likes "Set system language" but it's now removed in the latest GDM.
I put it as the back compatibility. If we set $GDM_LANG, normally it used to set the default system LANG and to show the default greeter locale.
If system has LC_ALL=ja_JP.UTF-8 and LC_MESSAGES=C and GDM_LANG=ja_JP.UTF-8, it would expect other CLI processes show C messages but GDM GUI shows the messages with GDM_LANG.
And then I put unsetenv (LC_MESSAGES) here.

However I removed GDM_LANG lines at the moment with your suggestion.
Actually I'm not sure if we still need GDM_LANG.
If we'll need GDM_LANG with other fixes, I'll file another bug.

> should probably be g_debug not g_warning.  It's not a bug if the file doesn't
> exist.

OK, I replaced g_warning wiht g_debug.

> need braces around hte if statements to match the coding style

OK, I put the braces.

> don't think we need (or want) an #ifdef here.

OK, I removed it.
Comment 6 Ray Strode [halfline] 2009-11-02 21:34:21 UTC
yea we removed GDM_LANG from 2.22 or something because it didn't seem relevant anymore.
Comment 7 Ray Strode [halfline] 2009-11-04 00:56:18 UTC
I'm not sure you're really calling this in the right place.  Wouldn't get_welcome_environment be a more natural place to hook in?
Comment 8 Takao Fujiwara 2009-11-04 01:27:06 UTC
(In reply to comment #7)
> I'm not sure you're really calling this in the right place.  Wouldn't
> get_welcome_environment be a more natural place to hook in?

OK, it seems better to put the fix in get_welcome_environment().
I will test it.
Comment 9 Takao Fujiwara 2009-11-04 10:38:48 UTC
Created attachment 146904 [details] [review]
Patch for configure.in, gdm.in, gdm-welcome-session.c

I revised the patch to update get_welcome_environment() with your suggestion.
I used optional_environment value.
Comment 10 Ray Strode [halfline] 2009-12-21 18:34:17 UTC
Comment on attachment 146904 [details] [review]
Patch for configure.in, gdm.in, gdm-welcome-session.c

thanks, pushed.