On Fri, Apr 26, 2013 at 12:18 AM, Reuben Thomas <rrt sc3d org> wrote:Of course:
> Thanks very much, that looks good. But is there no way to write this as a
> shell extension?
const ScreenShield = imports.ui.screenShield;
let _onUserBecameActiveOrig;
function _onUserBecameActiveInjected() {
this.idleMonitor.remove_watch(this._becameActiveId);
this._becameActiveId = 0;
let lightboxWasShown = this._lightbox.shown;
this._lightbox.hide();// or the screen is not locked
// Shortcircuit in case the mouse was moved before the fade completed
if (!lightboxWasShown || !this._isLocked) {function init() {
this.deactivate(false);
return;
}
}
}
function enable() {
_onUserBecameActiveOrig =
ScreenShield.ScreenShield.prototype._onUserBecameActive;
ScreenShield.ScreenShield.prototype._onUserBecameActive =
_onUserBecameActiveInjected;
}
function disable() {
ScreenShield.ScreenShield.prototype._onUserBecameActive =
_onUserBecameActiveOrig;
}