summaryrefslogtreecommitdiff
path: root/gnome-settings-daemon
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-10-23 13:50:48 +0200
committerDominique Leuenberger <dimstar@opensuse.org>2015-10-23 13:50:48 +0200
commit21a16d25d981f3ce34b764dbc8005dbf8edfbe97 (patch)
tree88138f04488139bdf8509a85cf37d0cbe47f4272 /gnome-settings-daemon
parenta21ad97ffe3fa81b037740d0df93b5cce7632a1f (diff)
downloadgnome-settings-daemon-21a16d25d981f3ce34b764dbc8005dbf8edfbe97.tar.gz
Don't override preset xim setups
When $QT_IM_MODULE or $XMODIFIERS has been already set beforehand, we should honor it and not override brutally. This makes GNOME as a good citizen coping with other IMs more smoothly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'gnome-settings-daemon')
-rwxr-xr-xgnome-settings-daemon/gnome-settings-daemon-localeexec.in4
-rw-r--r--gnome-settings-daemon/main.c11
2 files changed, 11 insertions, 4 deletions
diff --git a/gnome-settings-daemon/gnome-settings-daemon-localeexec.in b/gnome-settings-daemon/gnome-settings-daemon-localeexec.in
index eed91a4f..1edb3d20 100755
--- a/gnome-settings-daemon/gnome-settings-daemon-localeexec.in
+++ b/gnome-settings-daemon/gnome-settings-daemon-localeexec.in
@@ -13,8 +13,8 @@ if [ -n "$REGION" ]; then
fi
if [ -x @prefix@/bin/ibus-daemon ]; then
- export QT_IM_MODULE=ibus
- export XMODIFIERS=@im=ibus
+ test -z "$QT_IM_MODULE" && export QT_IM_MODULE=ibus
+ test -z "$XMODIFIERS" && export XMODIFIERS=@im=ibus
fi
exec @libexecdir@/gnome-settings-daemon
diff --git a/gnome-settings-daemon/main.c b/gnome-settings-daemon/main.c
index 4d1140b6..48d4bad4 100644
--- a/gnome-settings-daemon/main.c
+++ b/gnome-settings-daemon/main.c
@@ -255,9 +255,16 @@ is_program_in_path (const char *binary)
static void
set_legacy_ibus_env_vars (GDBusProxy *proxy)
{
+ const char *p;
if (is_program_in_path ("ibus-daemon")) {
- set_session_env (proxy, "QT_IM_MODULE", "ibus");
- set_session_env (proxy, "XMODIFIERS", "@im=ibus");
+ p = getenv ("QT_IM_MODULE");
+ if (!p || !*p)
+ p = "ibus";
+ set_session_env (proxy, "QT_IM_MODULE", p);
+ p = getenv ("XMODIFIERS");
+ if (!p || !*p)
+ p = "@im=ibus";
+ set_session_env (proxy, "XMODIFIERS", p);
}
}