[gnome-session] main: Don't override IM variables



commit 7060744ab857d867d74d553db4878df126211d56
Author: Gunnar Hjalmarsson <gunnarhj ubuntu com>
Date:   Sat Aug 13 21:32:00 2016 -0400

    main: Don't override IM variables
    
    To give a user the option to use some other input method framework but
    IBus, gnome-session should not override the QT_IM_MODULE and XMODIFIERS
    environment variables if they are already set. The desired approach has
    been implemented in gnome-settings-daemon:
    
    https://git.gnome.org/browse/gnome-settings-daemon/commit/?id=21a16d25d981f3ce34b764dbc8005dbf8edfbe97
    
    It would be consistent to change gnome-session in a similar way.

 gnome-session/main.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gnome-session/main.c b/gnome-session/main.c
index 4f5b7f5..f836920 100644
--- a/gnome-session/main.c
+++ b/gnome-session/main.c
@@ -399,8 +399,15 @@ main (int argc, char **argv)
                 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");
+                        const gchar *p;
+                        p = g_getenv ("QT_IM_MODULE");
+                        if (!p || !*p)
+                                p = "ibus";
+                        gsm_util_setenv ("QT_IM_MODULE", p);
+                        p = g_getenv ("XMODIFIERS");
+                        if (!p || !*p)
+                                p = "@im=ibus";
+                        gsm_util_setenv ("XMODIFIERS", p);
                 }
 
                 g_free (ibus_path);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]