From 51004e5cb32c07ffcf09ab4c71878a7edee68204 Mon Sep 17 00:00:00 2001 From: "blizzard%redhat.com" Date: Sat, 17 Jul 1999 17:24:04 +0000 Subject: [PATCH] Fix some scrolling anomolies. This fixes bug #10058. git-svn-id: svn://10.0.0.236/trunk@39885 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/xlib/nsWidget.cpp | 16 ++++++++-------- mozilla/widget/src/xlib/nsWidget.h | 3 --- mozilla/widget/src/xlib/nsWindow.cpp | 4 +--- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/mozilla/widget/src/xlib/nsWidget.cpp b/mozilla/widget/src/xlib/nsWidget.cpp index 2dc82a4c024..8dea8516f7d 100644 --- a/mozilla/widget/src/xlib/nsWidget.cpp +++ b/mozilla/widget/src/xlib/nsWidget.cpp @@ -73,8 +73,6 @@ nsWidget::nsWidget() : nsBaseWidget() mGC = 0; mParentWidget = nsnull; mName = "unnamed"; - mScrollX = 0; - mScrollY = 0; mIsShown = PR_FALSE; mIsToplevel = PR_FALSE; mIsMapped = PR_FALSE; @@ -409,9 +407,11 @@ NS_IMETHODIMP nsWidget::Show(PRBool bState) NS_IMETHODIMP nsWidget::IsVisible(PRBool &aState) { if (mIsMapped && (mVisibility != VisibilityFullyObscured)) { + PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWidget::IsVisible: yes\n")); aState = PR_TRUE; } else { + PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWidget::IsVisible: no\n")); aState = PR_FALSE; } return NS_OK; @@ -943,12 +943,12 @@ void nsWidget::WidgetShow(nsWidget *aWidget) PRBool nsWidget::WidgetVisible(nsRect &aBounds) { - nsRect mScrollArea; - mScrollArea.x = mScrollX; - mScrollArea.y = mScrollY; - mScrollArea.width = mBounds.width + mScrollX; - mScrollArea.height = mBounds.height + mScrollY; - if (mScrollArea.Intersects(aBounds)) { + nsRect scrollArea; + scrollArea.x = 0; + scrollArea.y = 0; + scrollArea.width = mBounds.width; + scrollArea.height = mBounds.height; + if (scrollArea.Intersects(aBounds)) { PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWidget::WidgetVisible(): widget is visible\n")); return PR_TRUE; } diff --git a/mozilla/widget/src/xlib/nsWidget.h b/mozilla/widget/src/xlib/nsWidget.h index f89ce009905..73d7e6f389e 100644 --- a/mozilla/widget/src/xlib/nsWidget.h +++ b/mozilla/widget/src/xlib/nsWidget.h @@ -151,9 +151,6 @@ protected: // check to see whether or not a rect will intersect with the current scrolled area PRBool WidgetVisible (nsRect &aBounds); - PRUint32 mScrollX; - PRUint32 mScrollY; - PRBool mIsShown; PRBool mIsMapped; int mVisibility; // this is an int because that's the way X likes it diff --git a/mozilla/widget/src/xlib/nsWindow.cpp b/mozilla/widget/src/xlib/nsWindow.cpp index e07c3475cfa..5b0da91459f 100644 --- a/mozilla/widget/src/xlib/nsWindow.cpp +++ b/mozilla/widget/src/xlib/nsWindow.cpp @@ -131,7 +131,7 @@ NS_IMETHODIMP nsWindow::Invalidate(const nsRect & aRect, PRBool aIsSynchronous) NS_IMETHODIMP nsWindow::Update() { - PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWindow::Update()\n")); + //PR_LOG(XlibWidgetsLM, PR_LOG_DEBUG, ("nsWindow::Update()\n")); nsPaintEvent pevent; pevent.message = NS_PAINT; @@ -151,8 +151,6 @@ NS_IMETHODIMP nsWindow::Update() NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) { PR_LOG(XlibScrollingLM, PR_LOG_DEBUG, ("nsWindow::Scroll()\n")); - mScrollX += aDx; - mScrollY += aDy; //-------- // Scroll the children