Re: Turning off the screen shield in gnome-shell 3.8
- From: Florian Müllner <fmuellner gnome org>
- To: Reuben Thomas <rrt sc3d org>
- Cc: gnome-shell-list <gnome-shell-list gnome org>
- Subject: Re: Turning off the screen shield in gnome-shell 3.8
- Date: Fri, 26 Apr 2013 00:35:01 +0200
On Fri, Apr 26, 2013 at 12:18 AM, Reuben Thomas <rrt sc3d org> wrote:
Thanks very much, that looks good. But is there no way to write this as a
shell extension?
Of course:
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();
// Shortcircuit in case the mouse was moved before the fade completed
// or the screen is not locked
if (!lightboxWasShown || !this._isLocked) {
this.deactivate(false);
return;
}
}
function init() {
}
function enable() {
_onUserBecameActiveOrig =
ScreenShield.ScreenShield.prototype._onUserBecameActive;
ScreenShield.ScreenShield.prototype._onUserBecameActive =
_onUserBecameActiveInjected;
}
function disable() {
ScreenShield.ScreenShield.prototype._onUserBecameActive =
_onUserBecameActiveOrig;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]