default button in dialog window is continuously repainted even when disabled

RESOLVED FIXED in mozilla22



Widget: Cocoa
5 years ago
4 years ago


(Reporter: jfkthame, Assigned: André Reinald)


Mac OS X

Firefox Tracking Flags

(Not tracked)



(1 attachment)



5 years ago
In dialog windows on OS X, the blue "default" button (if any) pulsates slightly, which entails continuously repainting it.

However, it turns out that we continuously repaint the button -even if it is disabled-, in which case it appears "flat" grey and does not visually pulsate. That's unnecessary, and it means that leaving such a dialog on screen, even when the window is inactive and/or the button disabled, will add significantly to Firefox's cpu and battery usage.

* In about:config, set nglayout.debug.paint_flashing = true
* Open Preferences, go to the Content panel, click the Exceptions button to the right of Block Pop-up Windows.

Note that although the "Allow" button in the dialog is disabled as long as no text is entered in the Address of Website field, it is being continuously repainted.

This persists even if another window or a different application is brought to the foreground.

This causes Firefox to hover around 3.5-4% CPU usage according to Activity Monitor on my MacBook, whereas without such a dialog open, it spends much of its time at 0.5-1%.

Fortunately, we don't have all that many windows with "default" buttons, but still, this seems like an inefficiency we ought to avoid. In addition to Firefox's built-in dialogs such as the Exceptions ones in Preferences, the same behavior applies in dialogs presented by add-ons.


5 years ago
Assignee: nobody → areinald

Comment 1

5 years ago
Created attachment 721140 [details] [diff] [review]
Avoid refreshing disabled or inactive default button

With thanks to Markus for his hint on how to best fix this. My first patch was much worse.
Attachment #721140 - Flags: review?(mstange)
Comment on attachment 721140 [details] [diff] [review]
Avoid refreshing disabled or inactive default button

Looks good to me.
I'm not sure about the current review policies in widget:cocoa, so I'm requesting review from Josh, too.
Attachment #721140 - Flags: review?(mstange)
Attachment #721140 - Flags: review?(joshmoz)
Attachment #721140 - Flags: review+

Comment 3

5 years ago
Comment on attachment 721140 [details] [diff] [review]
Avoid refreshing disabled or inactive default button

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

Looks good.

Current review policy for Cocoa widgets is that a review is required from an owner or peer. Since mstange is a peer, my review is technically unnecessary here.
Attachment #721140 - Flags: review?(joshmoz) → review+
OK, thanks


5 years ago
Keywords: checkin-needed
Keywords: checkin-needed
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
Depends on: 892547
You need to log in before you can comment on or make changes to this bug.