Bug 805261 - Implement nsChildView::GetScreenBounds() (MacOSX). r=BenWa
authorChris Pearce <cpearce@mozilla.com>
Mon, 11 Feb 2013 11:31:00 +1300
changeset 131352 a4257f41a6edc1eaf62b482c91ebe605dcd9b2d3
parent 131351 821c4263e71c7b356e0ab48288048923a569b927
child 131353 1ff7a764c2a9fcaaec2c6b254a86832c1bdf4fca
push idunknown
push userunknown
push dateunknown
reviewersBenWa
bugs805261
milestone21.0a1
Bug 805261 - Implement nsChildView::GetScreenBounds() (MacOSX). r=BenWa
widget/cocoa/nsChildView.h
widget/cocoa/nsChildView.mm
--- a/widget/cocoa/nsChildView.h
+++ b/widget/cocoa/nsChildView.h
@@ -395,16 +395,17 @@ public:
   NS_IMETHOD              Resize(double aX, double aY,
                                  double aWidth, double aHeight, bool aRepaint);
 
   NS_IMETHOD              Enable(bool aState);
   virtual bool            IsEnabled() const;
   NS_IMETHOD              SetFocus(bool aRaise);
   NS_IMETHOD              GetBounds(nsIntRect &aRect);
   NS_IMETHOD              GetClientBounds(nsIntRect &aRect);
+  NS_IMETHOD              GetScreenBounds(nsIntRect &aRect);
 
   // Returns the "backing scale factor" of the view's window, which is the
   // ratio of pixels in the window's backing store to Cocoa points. Prior to
   // HiDPI support in OS X 10.7, this was always 1.0, but in HiDPI mode it
   // will be 2.0 (and might potentially other values as screen resolutions
   // evolve). This gives the relationship between what Gecko calls "device
   // pixels" and the Cocoa "points" coordinate system.
   CGFloat                 BackingScaleFactor();
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -791,16 +791,23 @@ NS_IMETHODIMP nsChildView::GetClientBoun
     // For top level widgets we want the position on screen, not the position
     // of this view inside the window.
     MOZ_ASSERT(mWindowType != eWindowType_plugin, "plugin widgets should have parents");
     aRect.MoveTo(WidgetToScreenOffset());
   }
   return NS_OK;
 }
 
+NS_IMETHODIMP nsChildView::GetScreenBounds(nsIntRect &aRect)
+{
+  GetBounds(aRect);
+  aRect.MoveTo(WidgetToScreenOffset());
+  return NS_OK;
+}
+
 double
 nsChildView::GetDefaultScaleInternal()
 {
   return BackingScaleFactor();
 }
 
 CGFloat
 nsChildView::BackingScaleFactor()