[gnome-shell-extensions] alternative-status-menu: update for gnome-shell changes
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] alternative-status-menu: update for gnome-shell changes
- Date: Tue, 19 Feb 2013 22:34:05 +0000 (UTC)
commit ab3d3ce41b4bf34d84c0f0b3acd2064e30dd5718
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Tue Feb 19 23:27:18 2013 +0100
alternative-status-menu: update for gnome-shell changes
We use a logind inhibitor now, so we don't need to lock the screen before
calling logind. Also, the UPower path was removed, and suspension is not
available for ConsoleKit.
Sorry, Ubuntu users!
extensions/alternative-status-menu/extension.js | 35 +++++-----------------
1 files changed, 8 insertions(+), 27 deletions(-)
---
diff --git a/extensions/alternative-status-menu/extension.js b/extensions/alternative-status-menu/extension.js
index f1d83f0..ac033bf 100644
--- a/extensions/alternative-status-menu/extension.js
+++ b/extensions/alternative-status-menu/extension.js
@@ -31,8 +31,9 @@ function loginManager_hibernate() {
Gio.DBusCallFlags.NONE,
-1, null, null);
} else {
- // upower path
- this._upClient.hibernate_sync(null);
+ // Can't do in ConsoleKit
+ this.emit('prepare-for-sleep', true);
+ this.emit('prepare-for-sleep', false);
}
}
@@ -58,7 +59,7 @@ function loginManager_canHibernate(asyncCallback) {
});
} else {
Mainloop.idle_add(Lang.bind(this, function() {
- asyncCallback(this._upClient.get_can_hibernate());
+ asyncCallback(false);
return false;
}));
}
@@ -83,35 +84,15 @@ function statusMenu_updateSuspendOrPowerOff() {
function onSuspendActivate(item) {
Main.overview.hide();
- 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._loginManager.suspend();
- }));
-
- this.menu.close(BoxPointer.PopupAnimation.NONE);
- Main.screenShield.lock(true);
- } else {
- this._loginManager.suspend();
- }
+ this.menu.close(BoxPointer.PopupAnimation.NONE);
+ this._loginManager.suspend();
}
function onHibernateActivate(item) {
Main.overview.hide();
- if (this._screenSaverSettings.get_boolean(LOCK_ENABLED_KEY)) {
- let tmpId = Main.screenShield.connect('lock-screen-shown', Lang.bind(this, function() {
- Main.screenShield.disconnect(tmpId);
-
- loginManager_hibernate.call(this._loginManager);
- }));
-
- this.menu.close(BoxPointer.PopupAnimation.NONE);
- Main.screenShield.lock(true);
- } else {
- loginManager_hibernate.call(this._loginManager);
- }
+ this.menu.close(BoxPointer.PopupAnimation.NONE);
+ loginManager_hibernate.call(this._loginManager);
}
const Extension = new Lang.Class({
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]