зеркало из https://github.com/mozilla/gecko-dev.git
new method MoveToGlobalPoint. part of bug 23395.
This commit is contained in:
Родитель
0f83a227f0
Коммит
a28fb84e28
|
@ -652,6 +652,35 @@ NS_IMETHODIMP nsMacWindow::Move(PRInt32 aX, PRInt32 aY)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Resize this window to a point given in global (screen) coordinates. This
|
||||
// differs from simple Move(): that method makes JavaScript place windows
|
||||
// like other browsers: it puts the top-left corner of the outer edge of the
|
||||
// window border at the given coordinates, offset from the menubar.
|
||||
// MoveToGlobalPoint expects the top-left corner of the portrect, which
|
||||
// is inside the border, and is not offset by the menubar height.
|
||||
//
|
||||
//-------------------------------------------------------------------------
|
||||
void nsMacWindow::MoveToGlobalPoint(PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
#if TARGET_CARBON
|
||||
Rect screenRect;
|
||||
::GetRegionBounds(::GetGrayRgn(), &screenRect);
|
||||
#else
|
||||
Rect screenRect = (**::GetGrayRgn()).rgnBBox;
|
||||
#endif
|
||||
|
||||
if (mIsDialog) {
|
||||
aX -= kDialogMarginWidth;
|
||||
aY -= kDialogTitleBarHeight;
|
||||
} else {
|
||||
aX -= kWindowMarginWidth;
|
||||
aY -= kWindowTitleBarHeight;
|
||||
}
|
||||
Move(aX - screenRect.left, aY - screenRect.top);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
//
|
||||
// Resize this window
|
||||
|
|
|
@ -97,6 +97,8 @@ public:
|
|||
NS_IMETHOD ResetInputState();
|
||||
NS_IMETHOD PasswordFieldInit();
|
||||
|
||||
void MoveToGlobalPoint(PRInt32 aX, PRInt32 aY);
|
||||
|
||||
protected:
|
||||
|
||||
pascal static OSErr DragTrackingHandler ( DragTrackingMessage theMessage, WindowPtr theWindow,
|
||||
|
|
Загрузка…
Ссылка в новой задаче