зеркало из https://github.com/mozilla/pjs.git
Bug 588403. Part 1. The bounds of a popup widget are in screen coordinates; r=jimm
This commit is contained in:
Родитель
f7e007411c
Коммит
d2f9f6d315
|
@ -635,7 +635,9 @@ class nsIWidget : public nsISupports {
|
||||||
NS_IMETHOD SetFocus(PRBool aRaise = PR_FALSE) = 0;
|
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
|
* @param aRect On return it holds the x, y, width and height of
|
||||||
* this widget.
|
* this widget.
|
||||||
|
|
|
@ -1972,6 +1972,14 @@ NS_METHOD nsWindow::GetBounds(nsIntRect &aRect)
|
||||||
aRect.width = r.right - r.left;
|
aRect.width = r.right - r.left;
|
||||||
aRect.height = r.bottom - r.top;
|
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:
|
// chrome on parent:
|
||||||
// ___ 5,5 (chrome start)
|
// ___ 5,5 (chrome start)
|
||||||
// | ____ 10,10 (client start)
|
// | ____ 10,10 (client start)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче