Closed Bug 1159263 Opened 7 years ago Closed 7 years ago

Add support to nsCaret to stop blinking after a set of cycles


(Firefox for Android Graveyard :: Text Selection, defect)

Not set


(firefox40 fixed)

Firefox 40
Tracking Status
firefox40 --- fixed


(Reporter: mfinkle, Assigned: mfinkle)



(1 file)

We have feedback from partners that blinking cursors can increase power usage. We already have "ui.caretBlinkTime" to control the duration of a blink cycle, but we could add code to stop blinking after a few seconds.
After bug 1048752, roc seems to own nsCaret. I added snorp for the specific change to use a countdown value of 10 for mobile, but feedback on the C++ welcome too.

This patch adds a cycle countdown feature. Each time we ResetBlinking, we grab the "ui.caretBlinkCount" and use it in the timer callback. If the value is -1, we skip the countdown logic. Otherwise, we decrement and check for the value to hit 0. When it does, we simply StopBlinking and wait for the next ResetBlinking to start the process over again.

I tested the mobile value of 10 in a few situations, and it seems to work fine. The -1 (or no pref defined) situation works well too.

Try push here:
Assignee: nobody → mark.finkle
Attachment #8598670 - Flags: review?(snorp)
Attachment #8598670 - Flags: review?(roc)
Comment on attachment 8598670 [details] [diff] [review]
turn-off-your-blinker v0.1

Review of attachment 8598670 [details] [diff] [review]:

::: mobile/android/app/mobile.js
@@ +47,5 @@
>  /* allow scrollbars to float above chrome ui */
>  pref("ui.scrollbarsCanOverlapContent", 1);
> +/* turn off the caret blink after 10 cycles */
> +pref("ui.caretBlinkCount", 10);

I wonder if 10 is too many?
Attachment #8598670 - Flags: review?(snorp) → review+
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 40
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.