From c58af587e70abbc5ed91172be6cbaaea0ad0ee77 Mon Sep 17 00:00:00 2001 From: Markus Stange Date: Sat, 29 Jun 2013 03:05:07 +0200 Subject: [PATCH] Bug 888458 - Don't assume there's a focusView during viewWillDraw; always get the dirty region from our own view. r=smichaud --- widget/cocoa/nsChildView.mm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/widget/cocoa/nsChildView.mm b/widget/cocoa/nsChildView.mm index bf753e87cf09..68185ac1a5ca 100644 --- a/widget/cocoa/nsChildView.mm +++ b/widget/cocoa/nsChildView.mm @@ -2962,7 +2962,7 @@ NSEvent* gLastDragMouseDownEvent = nil; nsIntRect boundingRect = mGeckoChild->CocoaPointsToDevPixels(aRect); const NSRect *rects; NSInteger count; - [[NSView focusView] getRectsBeingDrawn:&rects count:&count]; + [self getRectsBeingDrawn:&rects count:&count]; if (count > MAX_RECTS_IN_REGION) { return boundingRect; @@ -2970,9 +2970,7 @@ NSEvent* gLastDragMouseDownEvent = nil; nsIntRegion region; for (NSInteger i = 0; i < count; ++i) { - // Add the rect to the region. - NSRect r = [self convertRect:rects[i] fromView:[NSView focusView]]; - region.Or(region, mGeckoChild->CocoaPointsToDevPixels(r)); + region.Or(region, mGeckoChild->CocoaPointsToDevPixels(rects[i])); } region.And(region, boundingRect); return region;