From f3596d389ef59e478c26f1001cc6a8ea6052f983 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Wed, 4 Nov 1998 21:46:00 +0000 Subject: [PATCH] Made changes for GetBounds to GetClientBounds conversion git-svn-id: svn://10.0.0.236/trunk@14104 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/view/src/nsView.cpp | 2 +- mozilla/view/src/nsViewManager.cpp | 7 +++++-- mozilla/webshell/public/nsIWebShell.h | 2 +- .../webshell/tests/viewer/nsBrowserWindow.cpp | 20 +++++++++---------- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/mozilla/view/src/nsView.cpp b/mozilla/view/src/nsView.cpp index f3fcb7ae515..e2e24c8caa4 100644 --- a/mozilla/view/src/nsView.cpp +++ b/mozilla/view/src/nsView.cpp @@ -1209,7 +1209,7 @@ void nsView :: List(FILE* out, PRInt32 aIndent) const fprintf(out, "%p ", this); if (nsnull != mWindow) { nsRect windowBounds; - mWindow->GetBounds(windowBounds); + mWindow->GetClientBounds(windowBounds); fprintf(out, "(widget=%p pos={%d,%d,%d,%d}) ", mWindow, windowBounds.x, windowBounds.y, diff --git a/mozilla/view/src/nsViewManager.cpp b/mozilla/view/src/nsViewManager.cpp index 8c914a6be17..0664f64ddbb 100644 --- a/mozilla/view/src/nsViewManager.cpp +++ b/mozilla/view/src/nsViewManager.cpp @@ -294,7 +294,7 @@ void nsViewManager :: Refresh(nsIView *aView, nsIRenderingContext *aContext, nsI { nsIWidget* widget; aView->GetWidget(widget); - widget->GetBounds(wrect); + widget->GetClientBounds(wrect); wrect.x = wrect.y = 0; NS_RELEASE(widget); ds = GetDrawingSurface(*localcx, wrect); @@ -380,7 +380,8 @@ void nsViewManager :: Refresh(nsIView *aView, nsIRenderingContext *aContext, con if (aUpdateFlags & NS_VMREFRESH_DOUBLE_BUFFER) { - mRootWindow->GetBounds(wrect); + mRootWindow->GetClientBounds(wrect); + wrect.x = wrect.y = 0; ds = GetDrawingSurface(*localcx, wrect); localcx->SelectOffScreenDrawingSurface(ds); } @@ -570,6 +571,8 @@ NS_IMETHODIMP nsViewManager :: DispatchEvent(nsGUIEvent *aEvent, nsEventStatus & nscoord width = ((nsSizeEvent*)aEvent)->windowSize->width; nscoord height = ((nsSizeEvent*)aEvent)->windowSize->height; + width = ((nsSizeEvent*)aEvent)->mWinWidth; + height = ((nsSizeEvent*)aEvent)->mWinHeight; // The root view may not be set if this is the resize associated with // window creation diff --git a/mozilla/webshell/public/nsIWebShell.h b/mozilla/webshell/public/nsIWebShell.h index 0f948f7d73a..1e064900a56 100644 --- a/mozilla/webshell/public/nsIWebShell.h +++ b/mozilla/webshell/public/nsIWebShell.h @@ -102,7 +102,7 @@ public: PRInt32 x, PRInt32 y, PRInt32 w, PRInt32 h, nsScrollPreference aScrolling = nsScrollPreference_kAuto, PRBool aAllowPlugins = PR_TRUE, - PRBool aIsSunkenBorder = PR_TRUE) = 0; + PRBool aIsSunkenBorder = PR_FALSE) = 0; /** * Notify the WebShell that its parent's window is being destroyed. After diff --git a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp index 1a3309989bc..00ec4babc23 100644 --- a/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp +++ b/mozilla/webshell/tests/viewer/nsBrowserWindow.cpp @@ -914,7 +914,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell, nsRect r(0, 0, aBounds.width, aBounds.height); mWindow->Create((nsIWidget*)NULL, r, HandleBrowserEvent, nsnull, aAppShell, nsnull, &initData); - mWindow->GetBounds(r); + mWindow->GetClientBounds(r); // Create web shell rv = nsRepository::CreateInstance(kWebShellCID, nsnull, @@ -926,7 +926,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell, r.x = r.y = 0; rv = mWebShell->Init(mWindow->GetNativeData(NS_NATIVE_WIDGET), r.x, r.y, r.width, r.height, - nsScrollPreference_kAuto, aAllowPlugins); + nsScrollPreference_kAuto, aAllowPlugins, PR_TRUE); mWebShell->SetContainer((nsIWebShellContainer*) this); mWebShell->SetObserver((nsIStreamObserver*)this); mWebShell->SetPrefs(aPrefs); @@ -937,7 +937,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell, if (NS_OK != rv) { return rv; } - mWindow->GetBounds(r); + mWindow->GetClientBounds(r); r.x = r.y = 0; } @@ -985,7 +985,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell, nsRect r(0, 0, aBounds.width, aBounds.height); mWindow->Create((nsIWidget*)NULL, r, HandleBrowserEvent, nsnull, aAppShell); - mWindow->GetBounds(r); + mWindow->GetClientBounds(r); // Create web shell rv = nsRepository::CreateInstance(kWebShellCID, nsnull, @@ -1008,7 +1008,7 @@ nsBrowserWindow::Init(nsIAppShell* aAppShell, if (NS_OK != rv) { return rv; } - mWindow->GetBounds(r); + mWindow->GetClientBounds(r); r.x = r.y = 0; } @@ -1179,14 +1179,14 @@ nsBrowserWindow::Layout(PRInt32 aWidth, PRInt32 aHeight) if (mLocation && NS_OK == mLocation->QueryInterface(kIWidgetIID,(void**)&locationWidget)) { if (mChromeMask & NS_CHROME_TOOL_BAR_ON) { if (mThrobber) { - locationWidget->Resize(2*BUTTON_WIDTH, 0, + locationWidget->Resize(2*BUTTON_WIDTH, 0, aWidth - (2*BUTTON_WIDTH + THROBBER_WIDTH), BUTTON_HEIGHT, PR_TRUE); - mThrobber->MoveTo(aWidth - THROBBER_WIDTH, 0); + mThrobber->MoveTo(aWidth - THROBBER_WIDTH, 0); } else { - locationWidget->Resize(2*BUTTON_WIDTH, 0, + locationWidget->Resize(2*BUTTON_WIDTH, 0, aWidth - 2*BUTTON_WIDTH, BUTTON_HEIGHT, PR_TRUE); @@ -1248,7 +1248,7 @@ nsBrowserWindow::SizeTo(PRInt32 aWidth, PRInt32 aHeight) NS_IMETHODIMP nsBrowserWindow::GetBounds(nsRect& aBounds) { - mWindow->GetBounds(aBounds); + mWindow->GetClientBounds(aBounds); return NS_OK; } @@ -1307,7 +1307,7 @@ nsBrowserWindow::SetChrome(PRUint32 aChromeMask) { mChromeMask = aChromeMask; nsRect r; - mWindow->GetBounds(r); + mWindow->GetClientBounds(r); Layout(r.width, r.height); return NS_OK;