diff -Nru unity-settings-daemon-15.04.1+16.10.20160819/debian/changelog unity-settings-daemon-15.04.1+16.10.20161003/debian/changelog --- unity-settings-daemon-15.04.1+16.10.20160819/debian/changelog 2016-10-03 10:18:25.000000000 +0000 +++ unity-settings-daemon-15.04.1+16.10.20161003/debian/changelog 2016-10-03 10:18:25.000000000 +0000 @@ -1,3 +1,15 @@ +unity-settings-daemon (15.04.1+16.10.20161003-0ubuntu1) yakkety; urgency=medium + + [ Dmitry Shachnev ] + * Upstart: Split XDG_CURRENT_DESKTOP properly and start only on Unity + sessions + + [ Iain Lane ] + * Check XDG_CURRENT_DESKTOP properly in the keyboard plugin (LP: + #1554878) + + -- iain@orangesquash.org.uk Mon, 03 Oct 2016 10:15:27 +0000 + unity-settings-daemon (15.04.1+16.10.20160819-0ubuntu2) yakkety; urgency=medium * Add systemd user unit. diff -Nru unity-settings-daemon-15.04.1+16.10.20160819/debian/unity-settings-daemon.user-session.upstart unity-settings-daemon-15.04.1+16.10.20161003/debian/unity-settings-daemon.user-session.upstart --- unity-settings-daemon-15.04.1+16.10.20160819/debian/unity-settings-daemon.user-session.upstart 2016-10-03 10:18:25.000000000 +0000 +++ unity-settings-daemon-15.04.1+16.10.20161003/debian/unity-settings-daemon.user-session.upstart 2016-10-03 10:18:25.000000000 +0000 @@ -1,8 +1,18 @@ description "The Unity Settings Daemon" author "Dimitri John Ledkov " -start on started dbus and starting gnome-session INSTANCE!=GNOME +start on started dbus and starting gnome-session stop on stopping gnome-session +pre-start script + for DESKTOP in $(echo "$XDG_CURRENT_DESKTOP" | sed 's/:/ /g') + do + if [ "x$DESKTOP" = "xUnity" ]; then + exit 0 + fi + done + stop +end script + respawn exec /usr/lib/unity-settings-daemon/unity-settings-daemon diff -Nru unity-settings-daemon-15.04.1+16.10.20160819/plugins/keyboard/gsd-keyboard-manager.c unity-settings-daemon-15.04.1+16.10.20161003/plugins/keyboard/gsd-keyboard-manager.c --- unity-settings-daemon-15.04.1+16.10.20160819/plugins/keyboard/gsd-keyboard-manager.c 2016-08-19 17:46:52.000000000 +0000 +++ unity-settings-daemon-15.04.1+16.10.20161003/plugins/keyboard/gsd-keyboard-manager.c 2016-10-03 10:15:08.000000000 +0000 @@ -977,6 +977,29 @@ } } +static gboolean +in_desktop (const gchar *name) +{ + const gchar *desktop_name_list; + gchar **names; + gboolean in_list = FALSE; + gint i; + + desktop_name_list = g_getenv ("XDG_CURRENT_DESKTOP"); + if (!desktop_name_list) + return FALSE; + + names = g_strsplit (desktop_name_list, ":", -1); + for (i = 0; names[i] && !in_list; i++) + if (strcmp (names[i], name) == 0) { + in_list = TRUE; + break; + } + g_strfreev (names); + + return in_list; +} + static gchar * prepare_xkb_options (GsdKeyboardManager *manager, guint n_sources, @@ -1001,7 +1024,7 @@ * and doesn't call us so we can't set the group switching XKB * option in the first place otherwise the X server's switch * will take effect and we get a broken configuration. */ - if (n_sources < 2 || g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "Unity") == 0) + if (n_sources < 2 || in_desktop ("Unity")) strip_xkb_option (options, "grp:"); options_str = build_xkb_options_string (options);