[Pkg-xfce-devel] Bug#735265: Bug#735251: lightdm: user locale tweaks are clobbered by non-default locale

Olaf Meeuwissen olaf.meeuwissen at avasys.jp
Mon Jan 20 04:02:26 UTC 2014


Yves-Alexis Perez writes:

> On Fri, Jan 17, 2014 at 01:01:11PM +0900, Olaf Meeuwissen wrote:
>> Yves-Alexis Perez writes:
>> 
>> >> > But in any case, setting LANG in .xsessionrc doesn't make much sense
>> >> > imho.
>> >> 
>> >> Care to explain why?  For me the correct LANG value is essential to get
>> >> my input method editor to work correctly (or so it seems).
>> >> # Of course, setting it in ~/.dmrc works for me but I'd like to know why
>> >> # I should set it there too.
>> >
>> > The way I see it (as I already explained), you select the wanted locale
>> > (LANG) in the greeter language selector (and it gets saved to .dmrc for
>> > later). Then, if you need to “correct” (for LC_MESSAGES for example) you
>> > can do it un .xsessionrc.
>> 
>> The greeter language selector does not seem to set LANG. 
>
> The greeter doesn't set anything, it gets the menu selection and gives
> it to lightdm.
>
>> At the very
>> beginning of the /etc/X11/Xsession script LANG=C.
>
> Well, this one is a problem, it's should not be the case (and it's not
> the case for me on any of my box).

C is the default locale on my system.

>> FWIW, lightdm seems to be exporting GDM_LANG, see src/seat.c in the
>> configure_session() function.
>
> Indeed, I missed that.
>
>> I see it does the same for GDMSESSION.
>> Are these variables GTK+ or GNOME specific? 
>
> My guess is that they get used by GNOME applications.
>
>> If the latter, then maybe
>> lightdm shouldn't be exporting these, but what do I know?
>> Just an idea, but why not simply export LANG instead (or as well)?
>
> If you look really really hard, you'll see that LANG is set on the
> previous line.

And I obviously missed that ;-)

>> I'm off nuking GDM_LANG (and maybe GDMSESSION) in my ~/.xsessionrc and
>> see what breaks ;-)
>
> Since lightdm set GDM_LANG to the exact same value as LANG, I fail to
> see why it's not set to the correct value at the beginning of
> /etc/X11/Xsession, but at least that gives you something to look at.

Okay, I've been looking at the source code a bit.  Turns out that
session_set_env() does not set any environment variables directly.  It
adds them to an internal list (session->priv->env).  This list is
written to the session in `session_real_run()`.  I didn't find any calls
to `session_unset_env()` for either LANG and GDM_LANG so would expect
both to be set in the session.

However, the greeter and user session inherit the system default locale
courtesy of PAM as per comment in src/session-child.c.  This probably
explains why I see LANG=C at the start of my Xsession.

Anyway, I now nuke GDM_LANG in ~/.xsessionrc and have not seen any
breakage yet.  The `locale` output is as I expect it and my input method
editor works as it used to.  I no longer have a ~/.dmrc (and it is not
recreated when you don't save your session).  I can pick any language I
please from the chooser without this having *any* effect on my session.
That is, the chooser does not interfere with my customizations which is
what I want.

Hope this helps,
-- 
Olaf Meeuwissen, LPIC-2           FLOSS Engineer -- AVASYS CORPORATION
FSF Associate Member #1962               Help support software freedom
                 http://www.fsf.org/jf?referrer=1962



More information about the Pkg-xfce-devel mailing list