Attachment #474247: Part 3. Don't subtract the area of transparent widgets from what we need to draw on the parent widget. for bug #588403

View | Details | Raw Unified | Return to bug 588403
Collapse All | Expand All

(-)a/view/src/nsViewManager.cpp (-19 / +23 lines)
Line     Link Here 
 Lines 629-665   nsViewManager::UpdateWidgetArea(nsView * Link Here 
629
          // get the damage region into view's coordinate system and appunits
629
          // get the damage region into view's coordinate system and appunits
630
          nsRegion damage =
630
          nsRegion damage =
631
            ConvertRegionBetweenViews(intersection, aWidgetView, view);
631
            ConvertRegionBetweenViews(intersection, aWidgetView, view);
632
632
633
          // Update the child and it's children
633
          // Update the child and it's children
634
          viewManager->
634
          viewManager->
635
            UpdateWidgetArea(view, childWidget, damage, aIgnoreWidgetView);
635
            UpdateWidgetArea(view, childWidget, damage, aIgnoreWidgetView);
636
636
637
          // GetBounds should compensate for chrome on a toplevel widget
637
          // We only want to remove the area of the child widget from the area
638
          nsIntRect bounds;
638
          // we have to update if the child widget is opaque.
639
          childWidget->GetBounds(bounds);
639
          if (childWidget->GetTransparencyMode() == eTransparencyOpaque) {
640
            // GetBounds should compensate for chrome on a toplevel widget
641
            nsIntRect bounds;
642
            childWidget->GetBounds(bounds);
640
643
641
          nsIntPoint offset = bounds.TopLeft();
644
            nsIntPoint offset = bounds.TopLeft();
642
          // popup widget's bounds are in screen coords, not relative to
645
            // popup widget's bounds are in screen coords, not relative to
643
          // their parent widget, so we need an extra offset to translate
646
            // their parent widget, so we need an extra offset to translate
644
          // to the parent widget in that case.
647
            // to the parent widget in that case.
645
          nsWindowType type;
648
            nsWindowType type;
646
          childWidget->GetWindowType(type);
649
            childWidget->GetWindowType(type);
647
          if (type == eWindowType_popup) {
650
            if (type == eWindowType_popup) {
648
            offset -= aWidget->WidgetToScreenOffset();
651
              offset -= aWidget->WidgetToScreenOffset();
649
          }
652
            }
650
653
651
          nsTArray<nsIntRect> clipRects;
654
            nsTArray<nsIntRect> clipRects;
652
          childWidget->GetWindowClipRegion(&clipRects);
655
            childWidget->GetWindowClipRegion(&clipRects);
653
          for (PRUint32 i = 0; i < clipRects.Length(); ++i) {
656
            for (PRUint32 i = 0; i < clipRects.Length(); ++i) {
654
            nsRect rr = (clipRects[i] + offset).
657
              nsRect rr = (clipRects[i] + offset).
655
              ToAppUnits(AppUnitsPerDevPixel());
658
                ToAppUnits(AppUnitsPerDevPixel());
656
            children.Or(children, rr - aWidgetView->ViewToWidgetOffset()); 
659
              children.Or(children, rr - aWidgetView->ViewToWidgetOffset()); 
657
            children.SimplifyInward(20);
660
              children.SimplifyInward(20);
661
            }
658
          }
662
          }
659
        }
663
        }
660
      }
664
      }
661
    }
665
    }
662
  }
666
  }
663
667
664
  nsRegion leftOver;
668
  nsRegion leftOver;
665
  leftOver.Sub(intersection, children);
669
  leftOver.Sub(intersection, children);

Return to bug 588403