windows fix for 26834, windows need sanity checks to keep them on screen. r=hyatt, a=jar
git-svn-id: svn://10.0.0.236/trunk@62379 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6d4edde1eb
commit
d6681f6c63
@ -1121,6 +1121,23 @@ NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
||||
mBounds.y = aY;
|
||||
|
||||
if (mWnd) {
|
||||
// Make sure this window is actually on the screen before we move it
|
||||
// XXX: Needs multiple monitor support
|
||||
HDC dc = ::GetDC(mWnd);
|
||||
if(dc) {
|
||||
if (::GetDeviceCaps(dc, TECHNOLOGY) == DT_RASDISPLAY)
|
||||
{
|
||||
RECT workArea;
|
||||
::SystemParametersInfo(SPI_GETWORKAREA, 0, &workArea, 0);
|
||||
if(mBounds.x >= workArea.right)
|
||||
aX = mBounds.x = workArea.left;
|
||||
|
||||
if(mBounds.y >= workArea.bottom)
|
||||
aY = mBounds.y = workArea.top;
|
||||
}
|
||||
::ReleaseDC(mWnd, dc);
|
||||
}
|
||||
|
||||
nsIWidget *par = GetParent();
|
||||
HDWP deferrer = NULL;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user