Closed Bug 1054220 Opened 11 years ago Closed 10 years ago

Notification tray continuously repaints during network activity

Categories

(Firefox OS Graveyard :: Gaia::System, defect)

All
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1045017

People

(Reporter: cwiiis, Unassigned)

References

()

Details

During network activity, the notification tray continuously repaints, even when the icon doesn't seem to be changing. I expect the fact that it's the entire tray is because it's an element background instead of the actual element and fixing that may be a tricky layout problem. I suspect the fact that it's continuously repainting even when it isn't changing anything is down to some bad code in Gaia somewhere. Filing this bug to do the investigation, and if I'm right, at least fix the latter problem.
Having a look at this, and while I think the code could be improved by doing this: diff --git a/apps/system/js/statusbar.js b/apps/system/js/statusbar.js index 588fa2a..b27faa0 100644 --- a/apps/system/js/statusbar.js +++ b/apps/system/js/statusbar.js @@ -679,12 +679,16 @@ var StatusBar = { var icon = this.icons.networkActivity; - clearTimeout(this._networkActivityTimer); - icon.hidden = false; + if (this._networkActivityTimer) { + clearTimeout(this._networkActivityTimer); + } else { + icon.hidden = false; + } this._networkActivityTimer = setTimeout(function hideNetActivityIcon() { icon.hidden = true; - }, 500); + this._networkActivityTimer = null; + }.bind(this), 500); }, flightMode: function sb_flightMode() { That isn't the cause of the issue. It seems as long as that element is visible, it gets constantly redrawn, even if it hasn't changed.
(In reply to Chris Lord [:cwiiis] from comment #1) > That isn't the cause of the issue. It seems as long as that element is > visible, it gets constantly redrawn, even if it hasn't changed. We could try to hook up with GDB into the method that's repainting this and figure out why it's been constantly repainted. Just an extra note I forgot when we discussed this before: the icon is transparent, maybe this has something to do with the repainting. It might be interesting to try with a fully opaque animation and see if we get the same issue.
The image is an animated png, and I don't have any programs (except Firefox) that can open such an image correctly, so I don't know how many frames it is... It looks like it's 6 frames, but looking at the paint flashing, it appears to be updating more frequently than that... But this is all just visual observation and probably be wrong. I would say that actually only two of the frames are actually discernable, however, and it's overkill to have 6 frames for such a tiny and subtle animation. If we replaced this with a static image, that'd improve things, or even a 2-frame image that animates at a third of the speed. All that said, that doesn't help the underlying issue that updating anything in the statusbar causes the entire bar to repaint. If you go to http://chrislord.net/files/mozilla/moz-element-redraw.html and enable paint flashing, you can see that using an element as a background image causes the entire width of the element with the background to repaint on every change of the mirrored element. n?mattwoodrow to find out if this is something easily fixed, or if we need to work around it.
Flags: needinfo?(matt.woodrow)
oh moz-element :( It's fixable, but not easily. Would be better if you can just wrap the background in an inner div that isn't the full width.
Flags: needinfo?(matt.woodrow)
(In reply to Matt Woodrow (:mattwoodrow) from comment #4) > oh moz-element :( > > It's fixable, but not easily. Would be better if you can just wrap the > background in an inner div that isn't the full width. I have a WIP in bug 1045017 which I believe will fix that.
(In reply to (PTO) Vivien Nicolas (:vingtetun) (:21) - (NOT reading bugmails, needinfo? please) from comment #5) > (In reply to Matt Woodrow (:mattwoodrow) from comment #4) > > oh moz-element :( > > > > It's fixable, but not easily. Would be better if you can just wrap the > > background in an inner div that isn't the full width. > > I have a WIP in bug 1045017 which I believe will fix that. Matt, if we do work around this problem, does that mean this bug is not something worth fixing?
Flags: needinfo?(matt.woodrow)
Correct, I don't think it's worth the effort for now at least.
Flags: needinfo?(matt.woodrow)
(In reply to Matt Woodrow (:mattwoodrow) from comment #7) > Correct, I don't think it's worth the effort for now at least. Ok, let's see if bug 1045017 successfully works around this problem and if so close as WONTFIX. If, however, it doesn't fix the problem we should investigate other options.
Depends on: 1045017
(In reply to Michael Henretty [:mhenretty] from comment #8) > (In reply to Matt Woodrow (:mattwoodrow) from comment #7) > > Correct, I don't think it's worth the effort for now at least. > > Ok, let's see if bug 1045017 successfully works around this problem and if > so close as WONTFIX. If, however, it doesn't fix the problem we should > investigate other options. well, we should dupe rather than WONTFIX I think, as it would have been fixed. I've noticed another bug with moz-element that will be fixed by this, so I won't bother filing, but just ftr, note that the animated network strength indicator when searching for a mobile network doesn't animate on the moz-element statusbar unless something else is also changing/animating.
Chris, now that bug 1045017 is fixed, can we close this bug? ie., do we no longer continuously repaint the statusbar?
Flags: needinfo?(chrislord.net)
Gu in green! \o/ I think we can official revert the dirty hack in bug 1052241. Leaving ni? for :cwiiis just to make sure statusbar is behaving better.
No longer blocks: 1052241
Yup, looks good :) It still repaints more often than it could (seemingly due to flipping from active/inactive layers?), but I'd say it's perfectly acceptable now.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(chrislord.net)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.