[gnome-shell] screenSaver: bugfixes
- From: Dan Winship <danw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] screenSaver: bugfixes
- Date: Thu, 14 Jul 2011 16:51:21 +0000 (UTC)
commit 5f86e29830e5921069679074f7cff65143b1f676
Author: Dan Winship <danw gnome org>
Date: Wed Jul 13 15:07:39 2011 -0400
screenSaver: bugfixes
Fix the signal handling; you can't use this.connect('ActiveChanged')
to connect to a D-Bus signal after replacing the signal methods with
the lang.signals versions. Just leave it using the D-Bus signal names,
just like it uses the D-Bus method names.
Also, remove the "_" from "_screenSaverActive", to match what
AutomountManager checks for, and remove getActive(), since it's not
needed.
https://bugzilla.gnome.org/show_bug.cgi?id=654550
js/misc/screenSaver.js | 14 ++++----------
js/ui/automountManager.js | 4 ++--
2 files changed, 6 insertions(+), 12 deletions(-)
---
diff --git a/js/misc/screenSaver.js b/js/misc/screenSaver.js
index da592f6..f9d6af8 100644
--- a/js/misc/screenSaver.js
+++ b/js/misc/screenSaver.js
@@ -2,7 +2,6 @@
const DBus = imports.dbus;
const Lang = imports.lang;
-const Signals = imports.signals;
const ScreenSaverIface = {
name: 'org.gnome.ScreenSaver',
@@ -32,28 +31,23 @@ ScreenSaverProxy.prototype = {
Lang.bind(this, this._onSSAppeared),
Lang.bind(this, this._onSSVanished));
+ this.screenSaverActive = false;
this.connect('ActiveChanged',
Lang.bind(this, this._onActiveChanged));
},
_onSSAppeared: function(owner) {
this.GetActiveRemote(Lang.bind(this, function(isActive) {
- this._screenSaverActive = isActive;
+ this.screenSaverActive = isActive;
}))
},
_onSSVanished: function(oldOwner) {
- this._screenSaverActive = false;
+ this.screenSaverActive = false;
},
_onActiveChanged: function(object, isActive) {
- this._screenSaverActive = isActive;
- this.emit('active-changed', this._screenSaverActive);
- },
-
- getActive: function() {
- return this._screenSaverActive;
+ this.screenSaverActive = isActive;
}
};
DBus.proxifyPrototype(ScreenSaverProxy.prototype, ScreenSaverIface);
-Signals.addSignalMethods(ScreenSaverProxy.prototype);
diff --git a/js/ui/automountManager.js b/js/ui/automountManager.js
index 7afb551..93b093a 100644
--- a/js/ui/automountManager.js
+++ b/js/ui/automountManager.js
@@ -86,7 +86,7 @@ AutomountManager.prototype = {
this.ckListener = new ConsoleKitManager();
this._ssProxy = new ScreenSaver.ScreenSaverProxy();
- this._ssProxy.connect('active-changed',
+ this._ssProxy.connect('ActiveChanged',
Lang.bind(this,
this._screenSaverActiveChanged));
@@ -201,7 +201,7 @@ AutomountManager.prototype = {
if (!this.ckListener.sessionActive)
return;
- if (this._ssProxy.getActive()) {
+ if (this._ssProxy.screenSaverActive) {
if (this._volumeQueue.indexOf(volume) == -1)
this._volumeQueue.push(volume);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]