Bug 588403. Part 1. The bounds of a popup widget are in screen coordinates; r=jimm

This commit is contained in:
Timothy Nikkel 2011-04-01 01:20:40 -04:00
parent cc872feab8
commit b8fe323cbb
2 changed files with 11 additions and 1 deletions

View File

@ -635,7 +635,9 @@ class nsIWidget : public nsISupports {
NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE) = 0;
/**
* Get this widget's outside dimensions relative to its parent widget
* Get this widget's outside dimensions relative to its parent widget. For
* popup widgets the returned rect is in screen coordinates and not
* relative to its parent widget.
*
* @param aRect On return it holds the x, y, width and height of
* this widget.

View File

@ -1972,6 +1972,14 @@ NS_METHOD nsWindow::GetBounds(nsIntRect &aRect)
aRect.width = r.right - r.left;
aRect.height = r.bottom - r.top;
// popup window bounds' are in screen coordinates, not relative to parent
// window
if (mWindowType == eWindowType_popup) {
aRect.x = r.left;
aRect.y = r.top;
return NS_OK;
}
// chrome on parent:
// ___ 5,5 (chrome start)
// | ____ 10,10 (client start)