Bug 1228125 (part 2) - Remove nsIWidget::GetScreenBoundsUntyped(). r=botond.

This commit is contained in:
Nicholas Nethercote 2015-11-25 20:55:34 -08:00
parent bae167ebf7
commit f64ae33631
3 changed files with 6 additions and 15 deletions

View File

@ -283,11 +283,11 @@ PopupBoxObject::GetOuterScreenRect()
if (view) {
nsIWidget* widget = view->GetWidget();
if (widget) {
nsIntRect screenRect;
widget->GetScreenBoundsUntyped(screenRect);
LayoutDeviceIntRect screenRect;
widget->GetScreenBounds(screenRect);
int32_t pp = menuPopupFrame->PresContext()->AppUnitsPerDevPixel();
rect->SetLayoutRect(ToAppUnits(screenRect, pp));
rect->SetLayoutRect(LayoutDeviceIntRect::ToAppUnits(screenRect, pp));
}
}
return rect.forget();

View File

@ -2377,8 +2377,8 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent)
LOG(("configure event [%p] %d %d %d %d\n", (void *)this,
aEvent->x, aEvent->y, aEvent->width, aEvent->height));
nsIntRect screenBounds;
GetScreenBoundsUntyped(screenBounds);
LayoutDeviceIntRect screenBounds;
GetScreenBounds(screenBounds);
if (mWindowType == eWindowType_toplevel || mWindowType == eWindowType_dialog) {
// This check avoids unwanted rollup on spurious configure events from
@ -2410,7 +2410,7 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent)
return FALSE;
}
mBounds.MoveTo(screenBounds.TopLeft());
mBounds.MoveTo(screenBounds.TopLeft().ToUnknownPoint());
// XXX mozilla will invalidate the entire window after this move
// complete. wtf?

View File

@ -825,19 +825,10 @@ class nsIWidget : public nsISupports {
* Get this widget's outside dimensions in global coordinates. This
* includes any title bar on the window.
*
* The untyped version exists temporarily to ease conversion to typed
* coordinates.
*
* @param aRect On return it holds the x, y, width and height of
* this widget.
*/
NS_IMETHOD GetScreenBounds(LayoutDeviceIntRect& aRect) = 0;
NS_IMETHOD GetScreenBoundsUntyped(nsIntRect& aRect) {
LayoutDeviceIntRect tmp;
nsresult rv = GetScreenBounds(tmp);
aRect = tmp.ToUnknownRect();
return rv;
}
/**
* Similar to GetScreenBounds except that this function will always