Commit 39f146e6 authored by Giovanni Campagna's avatar Giovanni Campagna Committed by Ray Strode

Read and apply LC_* environment variables from GSettings

Before anything else runs

https://bugzilla.gnome.org/show_bug.cgi?id=756324
parent a8896cca
......@@ -380,6 +380,7 @@ data/icons/48x48/Makefile
data/icons/scalable/Makefile
data/icons/symbolic/Makefile
gnome-session/Makefile
gnome-session/gnome-session
tools/Makefile
po/Makefile.in
])
......
EXTRA_DIST =
NULL =
bin_PROGRAMS = gnome-session
libexec_PROGRAMS = gnome-session-failed
bin_SCRIPTS = gnome-session
libexec_PROGRAMS = gnome-session-binary gnome-session-failed
noinst_LTLIBRARIES = libgsmutil.la
noinst_PROGRAMS = \
test-client-dbus \
......@@ -16,7 +16,7 @@ AM_CPPFLAGS = \
AM_CFLAGS = $(WARN_CFLAGS)
gnome_session_SOURCES = \
gnome_session_binary_SOURCES = \
$(BUILT_SOURCES) \
gsm-app.h \
gsm-app.c \
......@@ -62,12 +62,12 @@ gnome_session_SOURCES = \
gsm-xsmp-server.h
if HAVE_CONSOLEKIT
gnome_session_SOURCES += gsm-consolekit.c gsm-consolekit.h
gnome_session_binary_SOURCES += gsm-consolekit.c gsm-consolekit.h
else
EXTRA_DIST += gsm-consolekit.c gsm-consolekit.h
endif
gnome_session_CPPFLAGS = \
gnome_session_binary_CPPFLAGS = \
$(AM_CPPFLAGS) \
$(X11_CFLAGS) \
$(SM_CFLAGS) \
......@@ -84,7 +84,7 @@ gnome_session_CPPFLAGS = \
-DGCONF_SANITY_CHECK=\""$(GCONF_SANITY_CHECK)"\" \
-DGCONFTOOL_CMD=\"$(GCONFTOOL)\"
gnome_session_LDADD = \
gnome_session_binary_LDADD = \
libgsmutil.la \
$(X11_LIBS) \
$(SM_LIBS) \
......
#!/bin/sh
SETTING=$(gsettings get org.gnome.system.locale region)
REGION=${SETTING#\'}
REGION=${REGION%\'}
if [ -n "$REGION" ]; then
export LC_TIME=$REGION
export LC_NUMERIC=$REGION
export LC_MONETARY=$REGION
export LC_MEASUREMENT=$REGION
export LC_PAPER=$REGION
fi
exec @libexecdir@/gnome-session-binary "$@"
......@@ -227,6 +227,15 @@ check_gl (GError **error)
return g_spawn_check_exit_status (status, error);
}
static inline void
maybe_push_env_var (const char* name)
{
const char *value = g_getenv (name);
if (value)
gsm_util_setenv (name, value);
}
int
main (int argc, char **argv)
{
......@@ -340,6 +349,26 @@ main (int argc, char **argv)
if (g_getenv ("XDG_CURRENT_DESKTOP") == NULL)
gsm_util_setenv ("XDG_CURRENT_DESKTOP", "GNOME");
/* Push locale variables to dbus-daemon */
maybe_push_env_var ("LC_TIME");
maybe_push_env_var ("LC_NUMERIC");
maybe_push_env_var ("LC_MONETARY");
maybe_push_env_var ("LC_MEASUREMENT");
maybe_push_env_var ("LC_PAPER");
{
gchar *ibus_path;
ibus_path = g_find_program_in_path("ibus-daemon");
if (ibus_path) {
gsm_util_setenv ("QT_IM_MODULE", "ibus");
gsm_util_setenv ("XMODIFIERS", "@im=ibus");
}
g_free (ibus_path);
}
/* Some third-party programs rely on GNOME_DESKTOP_SESSION_ID to
* detect if GNOME is running. We keep this for compatibility reasons.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment