aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-10-02 11:53:34 -0400
committerWilliam Hua <william.hua@canonical.com>2013-10-02 11:53:34 -0400
commitd5dab6b801cd8d3ab4519cbf45ae37c27feb3943 (patch)
tree00e6487ed095ec1c802a3f9831822cc33bc22405
parent673d3cc001462e480ce000c713b3994cd8c58354 (diff)
downloadayatana-indicator-keyboard-d5dab6b801cd8d3ab4519cbf45ae37c27feb3943.tar.gz
ayatana-indicator-keyboard-d5dab6b801cd8d3ab4519cbf45ae37c27feb3943.tar.bz2
ayatana-indicator-keyboard-d5dab6b801cd8d3ab4519cbf45ae37c27feb3943.zip
Get greeter unique bus name from environment.
-rw-r--r--lib/main.vala16
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 5357862c..c40cc112 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -58,11 +58,15 @@ public class Indicator.Keyboard.Service : Object {
}
if (is_login_user ()) {
- Bus.watch_name (BusType.SESSION,
- "com.canonical.UnityGreeter",
- BusNameWatcherFlags.NONE,
- handle_name_appeared,
- handle_name_vanished);
+ var name = Environment.get_variable ("UNITY_GREETER_DBUS_NAME");
+
+ if (name != null) {
+ Bus.watch_name (BusType.SESSION,
+ (!) name,
+ BusNameWatcherFlags.NONE,
+ handle_name_appeared,
+ handle_name_vanished);
+ }
}
indicator_settings = new Settings ("com.canonical.indicator.keyboard");
@@ -720,7 +724,7 @@ public class Indicator.Keyboard.Service : Object {
[DBus (visible = false)]
private void handle_name_appeared (DBusConnection connection, string name, string name_owner) {
try {
- greeter = Bus.get_proxy_sync (BusType.SESSION, "com.canonical.UnityGreeter", "/list");
+ greeter = Bus.get_proxy_sync (BusType.SESSION, name, "/list");
((!) greeter).entry_selected.connect (handle_entry_selected);
} catch (IOError error) {
warning ("error: %s", error.message);