From da40aa33506447970ea91f7dfd5ab0b98d815258 Mon Sep 17 00:00:00 2001 From: "waqar%netscape.com" Date: Tue, 18 Jan 2000 21:55:31 +0000 Subject: [PATCH] # 24238 r kmcclusk@netscape.com d Added ScrollWidgets methods to nsWindow. This is same bug as 22067 for windows. git-svn-id: svn://10.0.0.236/trunk@58126 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/widget/src/gtk/nsWindow.cpp | 29 +++++++++++++++++++++++++++++ mozilla/widget/src/gtk/nsWindow.h | 1 + 2 files changed, 30 insertions(+) diff --git a/mozilla/widget/src/gtk/nsWindow.cpp b/mozilla/widget/src/gtk/nsWindow.cpp index 15603936a21..34a834688eb 100644 --- a/mozilla/widget/src/gtk/nsWindow.cpp +++ b/mozilla/widget/src/gtk/nsWindow.cpp @@ -1734,6 +1734,35 @@ NS_IMETHODIMP nsWindow::Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect) } return NS_OK; } +//------------------------------------------------------------------------- +// +// Scroll the bits of a window +// +//------------------------------------------------------------------------- + +NS_IMETHODIMP nsWindow::ScrollWidgets(PRInt32 aDx, PRInt32 aDy) +{ + UnqueueDraw(); + mUpdateArea->Offset(aDx, aDy); + // printf("mScrollExposeCounter++ = %i\n", mScrollExposeCounter); + mScrollExposeCounter++; + + if (mSuperWin) { + // save the old backing color + nscolor currentColor = GetBackgroundColor(); + // this isn't too painful to do right before a scroll. + // as owen says "it's just 12 bytes sent to the server." + // and it makes scrolling look a lot better while still + // preserving the gray color when you drag another window + // on top or when just creating a window + gdk_window_set_back_pixmap(mSuperWin->bin_window, NULL, 0); + // scroll baby, scroll! + gdk_superwin_scroll(mSuperWin, aDx, aDy); + // reset the color + SetBackgroundColor(currentColor); + } + return NS_OK; +} NS_IMETHODIMP nsWindow::ScrollRect(nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy) { diff --git a/mozilla/widget/src/gtk/nsWindow.h b/mozilla/widget/src/gtk/nsWindow.h index d65869bb312..29ebafea793 100644 --- a/mozilla/widget/src/gtk/nsWindow.h +++ b/mozilla/widget/src/gtk/nsWindow.h @@ -62,6 +62,7 @@ public: virtual void* GetNativeData(PRUint32 aDataType); NS_IMETHOD Scroll(PRInt32 aDx, PRInt32 aDy, nsRect *aClipRect); + NS_IMETHOD ScrollWidgets(PRInt32 aDx, PRInt32 aDy); NS_IMETHOD ScrollRect(nsRect &aSrcRect, PRInt32 aDx, PRInt32 aDy); NS_IMETHOD SetTitle(const nsString& aTitle);