mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-12 04:45:45 +00:00
b=29311 r=rods@netscape.com Added code in nsWindow::Move
Check to see if window needs to be removed first to avoid a costly call to SetWindowPos.
This commit is contained in:
parent
ffcd6f5401
commit
b03a771467
@ -1101,6 +1101,21 @@ NS_METHOD nsWindow::ModalEventFilter(PRBool aRealEvent, void *aEvent,
|
||||
//-------------------------------------------------------------------------
|
||||
NS_METHOD nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
||||
{
|
||||
// Check to see if window needs to be removed first
|
||||
// to avoid a costly call to SetWindowPos. This check
|
||||
// can not be moved to the calling code in nsView, because
|
||||
// some platforms do not position child windows correctly
|
||||
|
||||
nsRect currentRect;
|
||||
GetBounds(currentRect);
|
||||
{
|
||||
if ((currentRect.x == aX) && (currentRect.y == aY))
|
||||
{
|
||||
// Nothing to do, since it is already positioned correctly.
|
||||
return NS_OK;
|
||||
}
|
||||
}
|
||||
|
||||
// When moving a borderless top-level window the window
|
||||
// must be placed relative to its parent. WIN32 wants to
|
||||
// place it relative to the screen, so we used the cached parent
|
||||
|
Loading…
Reference in New Issue
Block a user