[gnome-shell-extensions] alternative-status-menu: fix for 3.6
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] alternative-status-menu: fix for 3.6
- Date: Mon, 8 Oct 2012 17:09:28 +0000 (UTC)
commit fa2840aee3b6167b48d67e0df7a5907a838b7790
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Mon Oct 8 19:07:46 2012 +0200
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.
extensions/alternative-status-menu/extension.js | 26 +++++++++++++++++++---
1 files changed, 22 insertions(+), 4 deletions(-)
---
diff --git a/extensions/alternative-status-menu/extension.js b/extensions/alternative-status-menu/extension.js
index 210b387..2438ecf 100644
--- a/extensions/alternative-status-menu/extension.js
+++ b/extensions/alternative-status-menu/extension.js
@@ -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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]