diff options
author | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 21:04:27 +0000 |
---|---|---|
committer | agl@chromium.org <agl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 21:04:27 +0000 |
commit | 78cee597d742db9f26833fb3411834fde2f922e7 (patch) | |
tree | 169452aa27eb16d85c10c6e25a0908cace59dece /chrome | |
parent | 76caaf9e133f071e32ca5ad13fb95613b23c1891 (diff) | |
download | chromium_src-78cee597d742db9f26833fb3411834fde2f922e7.zip chromium_src-78cee597d742db9f26833fb3411834fde2f922e7.tar.gz chromium_src-78cee597d742db9f26833fb3411834fde2f922e7.tar.bz2 |
Linux: fix scrolling
I had assuming that we always scroll the whole window; I was wrong.
This patch fixes issues with 'ghost' scrollbars appearing when the
window looses focus and with huge misrendering when scrolling iframes.
Review URL: http://codereview.chromium.org/42357
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12012 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/renderer_host/backing_store_x.cc | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/chrome/browser/renderer_host/backing_store_x.cc b/chrome/browser/renderer_host/backing_store_x.cc index e17e2ae..f9212f0 100644 --- a/chrome/browser/renderer_host/backing_store_x.cc +++ b/chrome/browser/renderer_host/backing_store_x.cc @@ -240,16 +240,28 @@ void BackingStore::ScrollRect(base::ProcessHandle process, if (dy) { // Positive values of |dy| scroll up + if (abs(dy) >= clip_rect.height()) + return; + XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_), - 0, std::max(0, -dy) /* source x, y */, - size_.width(), size_.height() - abs(dy), - 0, std::max(0, dy) /* dest x, y */); + clip_rect.x() /* source x */, + std::max(clip_rect.y(), clip_rect.y() - dy), + clip_rect.width(), + clip_rect.height() - abs(dy), + clip_rect.x() /* dest x */, + std::max(clip_rect.y(), clip_rect.y() + dy) /* dest y */); } else if (dx) { // Positive values of |dx| scroll right + if (abs(dx) >= clip_rect.width()) + return; + XCopyArea(display_, pixmap_, pixmap_, static_cast<GC>(pixmap_gc_), - std::max(0, -dx), 0 /* source x, y */, - size_.width() - abs(dx), size_.height(), - std::max(0, dx), 0 /* dest x, y */); + std::max(clip_rect.x(), clip_rect.x() - dx), + clip_rect.y() /* source y */, + clip_rect.width() - abs(dx), + clip_rect.height(), + std::max(clip_rect.x(), clip_rect.x() + dx) /* dest x */, + clip_rect.y() /* dest x */); } PaintRect(process, bitmap, bitmap_rect); |