Closed Bug 839029 Opened 12 years ago Closed 12 years ago

default button in dialog window is continuously repainted even when disabled

Categories

(Core :: Widget: Cocoa, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla22

People

(Reporter: jfkthame, Assigned: areinald.bug)

References

Details

Attachments

(1 file)

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: nobody → areinald
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 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
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: