зеркало из https://github.com/mozilla/gecko-dev.git
b=601545 use mNeedsResize/mNeedsMove on toplevel windows to make mPlaced unnecessary r+a=roc
--HG-- extra : transplant_source : %BFS%22L%95%98%9A%07%E5%7F%7E%3C%3E%87%10%FF%24%02I%3B
This commit is contained in:
Родитель
a37baa7eba
Коммит
0f4db8c148
|
@ -392,7 +392,6 @@ nsWindow::nsWindow()
|
|||
mNeedsShow = PR_FALSE;
|
||||
mEnabled = PR_TRUE;
|
||||
mCreated = PR_FALSE;
|
||||
mPlaced = PR_FALSE;
|
||||
|
||||
mContainer = nsnull;
|
||||
mGdkWindow = nsnull;
|
||||
|
@ -1156,7 +1155,6 @@ nsWindow::Resize(PRInt32 aX, PRInt32 aY, PRInt32 aWidth, PRInt32 aHeight,
|
|||
mBounds.SizeTo(GetSafeWindowSize(nsIntSize(aWidth, aHeight)));
|
||||
|
||||
mNeedsMove = PR_TRUE;
|
||||
mPlaced = PR_TRUE;
|
||||
|
||||
if (!mCreated)
|
||||
return NS_OK;
|
||||
|
@ -1241,8 +1239,6 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
|||
SetSizeMode(nsSizeMode_Normal);
|
||||
}
|
||||
|
||||
mPlaced = PR_TRUE;
|
||||
|
||||
// Since a popup window's x/y coordinates are in relation to to
|
||||
// the parent, the parent might have moved so we always move a
|
||||
// popup window.
|
||||
|
@ -1258,6 +1254,8 @@ nsWindow::Move(PRInt32 aX, PRInt32 aY)
|
|||
if (!mCreated)
|
||||
return NS_OK;
|
||||
|
||||
mNeedsMove = PR_FALSE;
|
||||
|
||||
if (mIsTopLevel) {
|
||||
gtk_window_move(GTK_WINDOW(mShell), aX, aY);
|
||||
}
|
||||
|
@ -2311,7 +2309,6 @@ nsWindow::OnConfigureEvent(GtkWidget *aWidget, GdkEventConfigure *aEvent)
|
|||
// by the layout engine. Width and height are set elsewhere.
|
||||
nsIntPoint pnt(aEvent->x, aEvent->y);
|
||||
if (mIsTopLevel) {
|
||||
mPlaced = PR_TRUE;
|
||||
// Need to translate this into the right coordinates
|
||||
mBounds.MoveTo(WidgetToScreenOffset());
|
||||
pnt = mBounds.TopLeft();
|
||||
|
@ -3777,11 +3774,13 @@ nsWindow::Create(nsIWidget *aParent,
|
|||
mBounds = aRect;
|
||||
if (mWindowType != eWindowType_child &&
|
||||
mWindowType != eWindowType_plugin) {
|
||||
// The window manager might place us. Indicate that if we're
|
||||
// shown, we want to go through
|
||||
// nsWindow::NativeResize(x,y,w,h) to maybe set our own
|
||||
// position.
|
||||
mNeedsMove = PR_TRUE;
|
||||
// We only move a toplevel window if someone has actually placed the
|
||||
// window somewhere. If no placement has taken place, we just let the
|
||||
// window manager Do The Right Thing.
|
||||
//
|
||||
// Indicate that if we're shown, we at least need to have our size set.
|
||||
// If we get explicitly moved, the position will also be set.
|
||||
mNeedsResize = PR_TRUE;
|
||||
}
|
||||
|
||||
// figure out our parent window
|
||||
|
@ -4311,13 +4310,7 @@ nsWindow::NativeResize(PRInt32 aX, PRInt32 aY,
|
|||
ResizeTransparencyBitmap(aWidth, aHeight);
|
||||
|
||||
if (mIsTopLevel) {
|
||||
// We only move the toplevel window if someone has
|
||||
// actually placed the window somewhere. If no placement
|
||||
// has taken place, we just let the window manager Do The
|
||||
// Right Thing.
|
||||
if (mPlaced)
|
||||
gtk_window_move(GTK_WINDOW(mShell), aX, aY);
|
||||
|
||||
gtk_window_move(GTK_WINDOW(mShell), aX, aY);
|
||||
gtk_window_resize(GTK_WINDOW(mShell), aWidth, aHeight);
|
||||
}
|
||||
else if (mContainer) {
|
||||
|
|
|
@ -373,9 +373,6 @@ protected:
|
|||
PRPackedBool mEnabled;
|
||||
// has the native window for this been created yet?
|
||||
PRPackedBool mCreated;
|
||||
// Has anyone set an x/y location for this widget yet? Toplevels
|
||||
// shouldn't be automatically set to 0,0 for first show.
|
||||
PRPackedBool mPlaced;
|
||||
|
||||
private:
|
||||
void DestroyChildWindows();
|
||||
|
|
Загрузка…
Ссылка в новой задаче