gdm: Only create the Manager we're going to use

Otherwise gnome-shell crashes when systemd is installed but not in use,
because bus activation of logind fails.

https://bugzilla.gnome.org/show_bug.cgi?id=672240
This commit is contained in:
Jan Alexander Steffens (heftig) 2012-03-16 17:07:47 +01:00 committed by Adel Gadllah
parent ceb17dc713
commit c7182589d2

View File

@ -33,10 +33,13 @@ const PowerMenuButton = new Lang.Class({
_init: function() {
this.parent('system-shutdown', null);
this._consoleKitManager = new ConsoleKit.ConsoleKitManager();
this._systemdLoginManager = new Systemd.SystemdLoginManager();
this._upClient = new UPowerGlib.Client();
if (Systemd.haveSystemd())
this._systemdLoginManager = new Systemd.SystemdLoginManager();
else
this._consoleKitManager = new ConsoleKit.ConsoleKitManager();
this._createSubMenu();
this._upClient.connect('notify::can-suspend',