alternative-status-menu: fix for 3.6

Code was still refererring to the external screensaver instead of
activating the screenshield.
I feel like a genius for writing both modules and not noticing this
until after 3.6.0.
This commit is contained in:
Giovanni Campagna
2012-10-08 19:07:46 +02:00
parent e48e1d0a38
commit fa2840aee3
@@ -11,6 +11,8 @@ const ExtensionUtils = imports.misc.extensionUtils;
const Me = ExtensionUtils.getCurrentExtension();
const Convenience = Me.imports.convenience;
const LOCK_ENABLED_KEY = 'lock-enabled';
let suspend_item = null;
let hibernate_item = null;
let poweroff_item = null;
@@ -29,17 +31,33 @@ function updateHibernate(object, pspec, item) {
function onSuspendActivate(item) {
Main.overview.hide();
this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
if (this._screenSaverSettings.get_boolean(LOCK_ENABLED_KEY)) {
let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
Main.screenShield.disconnect(tmpId);
this._upClient.suspend_sync(null);
}));
Main.screenShield.lock(true);
} else {
this._upClient.suspend_sync(null);
}));
}
}
function onHibernateActivate(item) {
Main.overview.hide();
this._screenSaverProxy.LockRemote(Lang.bind(this, function() {
if (this._screenSaverSettings.get_boolean(LOCK_ENABLED_KEY)) {
let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
Main.screenShield.disconnect(tmpId);
this._upClient.hibernate_sync(null);
}));
Main.screenShield.lock(true);
} else {
this._upClient.hibernate_sync(null);
}));
}
}
// Put your extension initialization code here