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);