Closed Bug 1095210 Opened 10 years ago Closed 10 years ago

Incomplete titlebar repainting when titlebar buttons move

Categories

(Core :: Widget: Cocoa, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36
Tracking Status
firefox35 --- fixed
firefox36 --- fixed

People

(Reporter: mstange, Assigned: mstange)

References

Details

Attachments

(1 file)

This bug is about the issue found in bug 1093790 comment 5. It occurs when the titlebar buttons are repositioned during -[ChildView viewWillDraw].

The patch here may also fix bug 984200, but I can't test at the moment.

At the moment we get the area we need to repaint in the titlebar buffer by calling -[NSView getRectsBeingDrawn:count:] during -[ChildView viewWillDraw]. However, during the rest of viewWillDraw, we do a Gecko paint flush, which calls nsChildView::UpdateThemeGeometries, which can reposition the titlebar buttons, which causes native invalidations (from [frameView _tileTitlebarAndRedisplay:NO]), and those invalidations are lost. Any native invalidations that occur during viewWillDraw are not reflected in -[NSView getRectsBeingDrawn:count:] while viewWillDraw is still being executed. It's only when we enter -[ChildView drawRect:] that -[NSView getRectsBeingDrawn:count:] is updated with the other invalidations that occurred during viewWillDraw. But by then it's too late to call nsChildView::NotifyDirtyRegion because nsChildView::UpdateTitlebarCGContext is already called during viewWillDraw (during mGeckoChild->WillPaintWindow()).

So it looks like we can't rely on -[NSView getRectsBeingDrawn:count:] for this. The patch I'm going to attach instead records invalidations in -[BaseWindow _setNeedsDisplayInRect:].
Attached patch patchSplinter Review
Attachment #8518571 - Flags: review?(smichaud)
Comment on attachment 8518571 [details] [diff] [review]
patch

Looks fine to me.
Attachment #8518571 - Flags: review?(smichaud) → review+
https://hg.mozilla.org/mozilla-central/rev/92bf77a4cf4f
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
Comment on attachment 8518571 [details] [diff] [review]
patch

Approval Request Comment
[Feature/regressing bug #]: needed for bug 1093790
[User impact if declined]: partially-drawn titlebar buttons
[Describe test coverage new/current, TBPL]: none
[Risks and why]: low to medium
[String/UUID change made/needed]: none
Attachment #8518571 - Flags: approval-mozilla-aurora?
Attachment #8518571 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: