diff options
author | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 22:32:49 +0000 |
---|---|---|
committer | erg@google.com <erg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-03 22:32:49 +0000 |
commit | b39171b47da84c18b4dfabfaebe0a6318c96bc68 (patch) | |
tree | 77207c2e96a197be95548aa484cb3c27cb5c1e60 /chrome/browser | |
parent | a4d8a7bb664645e18a1d6045e94aa1f714a0a404 (diff) | |
download | chromium_src-b39171b47da84c18b4dfabfaebe0a6318c96bc68.zip chromium_src-b39171b47da84c18b4dfabfaebe0a6318c96bc68.tar.gz chromium_src-b39171b47da84c18b4dfabfaebe0a6318c96bc68.tar.bz2 |
GTK: Repaint the toolbar after the bookmark bar has finished.
This issue has been here for forever (or at least as long as far back as the
bisect script will let me check).
BUG=44502
TEST=See bug.
Review URL: http://codereview.chromium.org/2616001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48884 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/gtk/bookmark_bar_gtk.cc | 12 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 4 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 5 |
3 files changed, 20 insertions, 1 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index f8d9808..f5c9f53 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -809,8 +809,18 @@ void BookmarkBarGtk::AnimationProgressed(const Animation* animation) { void BookmarkBarGtk::AnimationEnded(const Animation* animation) { DCHECK_EQ(animation, slide_animation_.get()); - if (!slide_animation_->IsShowing()) + if (!slide_animation_->IsShowing()) { gtk_widget_hide(bookmark_hbox_); + + // We can be windowless during unit tests. + if (window_) { + // Because of our constant resizing and our toolbar/bookmark bar overlap + // shenanigans, gtk+ gets confused, partially draws parts of the bookmark + // bar into the toolbar and than doesn't queue a redraw to fix it. So do + // it manually by telling the toolbar area to redraw itself. + window_->QueueToolbarRedraw(); + } + } } void BookmarkBarGtk::Observe(NotificationType type, diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index d7fbfb6..0aec06f 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -1435,6 +1435,10 @@ void BrowserWindowGtk::BookmarkBarIsFloating(bool is_floating) { PlaceBookmarkBar(is_floating); } +void BrowserWindowGtk::QueueToolbarRedraw() { + gtk_widget_queue_draw(toolbar_->widget()); +} + void BrowserWindowGtk::SetGeometryHints() { // If we call gtk_window_maximize followed by gtk_window_present, compiz gets // confused and maximizes the window, but doesn't set the diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index fdbf27c..4120596 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -195,6 +195,11 @@ class BrowserWindowGtk : public BrowserWindow, // the toolbar (under the tab strip), but do not round the top corners. bool ShouldDrawContentDropShadow(); + // Tells GTK that the toolbar area is invalidated and needs redrawing. We + // have this method as a hack because GTK doesn't queue the toolbar area for + // redraw when it should. + void QueueToolbarRedraw(); + protected: virtual void DestroyBrowser(); // Top level window. |