The default bug view has changed. See this FAQ.

default button in dialog window is continuously repainted even when disabled

RESOLVED FIXED in mozilla22

Status

()

Core
Widget: Cocoa
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: jfkthame, Assigned: André Reinald)

Tracking

unspecified
mozilla22
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

4 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.

STR:
* 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.
(Assignee)

Updated

4 years ago
Assignee: nobody → areinald
(Assignee)

Comment 1

4 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

4 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
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/b1557651f08a
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/b1557651f08a
Status: NEW → RESOLVED
Last Resolved: 4 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.