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
Родитель f7e007411c
Коммит d2f9f6d315
2 изменённых файлов: 11 добавлений и 1 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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)