loginManager: listen to the correct object path

Use GetSession() to get the valid object path for the current
XDG_SESSION_ID.

https://bugzilla.gnome.org/show_bug.cgi?id=696287
This commit is contained in:
Cosimo Cecchi
2013-03-25 13:25:30 -04:00
parent b878f3fc4a
commit 869e1dc241
2 changed files with 40 additions and 17 deletions

View File

@ -512,9 +512,12 @@ const ScreenShield = new Lang.Class({
Lang.bind(this, this._prepareForSleep));
this._inhibitSuspend();
this._loginSession = this._loginManager.getCurrentSessionProxy();
this._loginSession.connectSignal('Lock', Lang.bind(this, function() { this.lock(false); }));
this._loginSession.connectSignal('Unlock', Lang.bind(this, function() { this.deactivate(false); }));
this._loginManager.getCurrentSessionProxy(Lang.bind(this,
function(sessionProxy) {
this._loginSession = sessionProxy;
this._loginSession.connectSignal('Lock', Lang.bind(this, function() { this.lock(false); }));
this._loginSession.connectSignal('Unlock', Lang.bind(this, function() { this.deactivate(false); }));
}));
this._settings = new Gio.Settings({ schema: SCREENSAVER_SCHEMA });