Merge lp:~mterry/unity-greeter/set-indicator-greeter-mode into lp:~robert-ancell/unity-greeter/trunk

Proposed by Michael Terry
Status: Merged
Merged at revision: 74
Proposed branch: lp:~mterry/unity-greeter/set-indicator-greeter-mode
Merge into: lp:~robert-ancell/unity-greeter/trunk
Diff against target: 40 lines (+30/-0)
1 file modified
src/user-list.vala (+30/-0)
To merge this branch: bzr merge lp:~mterry/unity-greeter/set-indicator-greeter-mode
Reviewer Review Type Date Requested Status
Robert Ancell Pending
Review via email: mp+70321@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/user-list.vala'
2--- src/user-list.vala 2011-07-26 04:21:25 +0000
3+++ src/user-list.vala 2011-08-03 17:45:54 +0000
4@@ -147,6 +147,36 @@
5
6 options_menu = new Gtk.Menu ();
7
8+ setup_indicators ();
9+ }
10+
11+ async void setup_indicators ()
12+ {
13+ // Set env var that will tell indicators to reduce functionality
14+ GLib.Environment.set_variable("INDICATOR_GREETER_MODE", "1", true);
15+
16+ // And also set it in the DBus activation environment so that any
17+ // indicator services pick it up.
18+ try {
19+ var proxy = new GLib.DBusProxy.for_bus_sync(GLib.BusType.SESSION,
20+ GLib.DBusProxyFlags.NONE, null,
21+ "org.freedesktop.DBus",
22+ "/org/freedesktop/DBus",
23+ "org.freedesktop.DBus",
24+ null);
25+
26+ var builder = new GLib.VariantBuilder(GLib.VariantType.ARRAY);
27+ builder.add("{ss}", "INDICATOR_GREETER_MODE", "1");
28+
29+ yield proxy.call("UpdateActivationEnvironment",
30+ new GLib.Variant("(a{ss})", builder),
31+ GLib.DBusCallFlags.NONE, -1, null);
32+ }
33+ catch (Error e) {
34+ warning("Could not get set environment for indicators: %s", e.message);
35+ return; // no indicators at all then
36+ }
37+
38 load_indicator ("/usr/lib/indicators3/6/libsession.so");
39 load_indicator ("/usr/lib/indicators3/6/libdatetime.so");
40 load_indicator ("/usr/lib/indicators3/6/libsoundmenu.so");

Subscribers

People subscribed via source and target branches

to all changes: