GNOME Bugzilla – Bug 690857
ScreenShield: don't animate arrows if the user is idle
Last modified: 2013-03-17 18:34:09 UTC
If the user is idle, it is very likely the monitor is off too, so let's save some power by avoiding animations noone is going to see.
Created attachment 232369 [details] [review] ScreenShield: don't animate arrows if the user is idle
Review of attachment 232369 [details] [review]: Makes sense. ::: js/ui/screenShield.js @@ +819,3 @@ + if (idleTime < ARROW_IDLE_TIME) { + if (!this._arrowAnimationId) { + this._arrowAnimationId = Mainloop.timeout_add(6000, Lang.bind(this, this._animateArrows)); Why is this hardcoded ? (Same in the old code but while you are touching this code you might as well just fix it; maybe a separate patch).
Review of attachment 232369 [details] [review]: I wrote the IdleMonitor API to be better than this. ::: js/ui/screenShield.js @@ +824,3 @@ + + if (!this._arrowWatchId) + this._arrowWatchId = this.idleMonitor.add_watch(ARROW_IDLE_TIME, If the user is idle, they'll always take the bottom path. @@ +834,3 @@ + if (!this._arrowBecameActiveId) + this._arrowBecameActiveId = this.idleMonitor.connect('became-active', + Lang.bind(this, this._checkArrowAnimation)); Likewise, if the user became active, we always know they're going to take the top path.
Created attachment 232553 [details] [review] ScreenShield: don't animate arrows if the user is idle If the user is idle, it is very likely the monitor is off too, so let's save some power by avoiding animations noone is going to see.
Hard code freeze ping!
Review of attachment 232553 [details] [review]: This needs an update for the new IdleMonitor API
Created attachment 239042 [details] [review] ScreenShield: don't animate arrows if the user is idle If the user is idle, it is very likely the monitor is off too, so let's save some power by avoiding animations noone is going to see. Oh! I had it rebased/updated locally, but forgot to attach.
Review of attachment 239042 [details] [review]: OK.
Attachment 239042 [details] pushed as a9815ae - ScreenShield: don't animate arrows if the user is idle