summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-17 04:19:31 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-17 04:19:31 +0000
commit5abe0b215627d04c94600e6403d7235b12986546 (patch)
tree8216f8189499d021b175e0b8dd28440066a0c6b5 /chrome/browser
parent6435179b196201aef5f451ab09ba8b2563c64e4d (diff)
downloadchromium_src-5abe0b215627d04c94600e6403d7235b12986546.zip
chromium_src-5abe0b215627d04c94600e6403d7235b12986546.tar.gz
chromium_src-5abe0b215627d04c94600e6403d7235b12986546.tar.bz2
Fixes painting bug in switching between ntp and non-ntp pages. Without
this code the bookmark bar's widget gets sized to 1x1 for a layout/painting step and we get all sorts of painting artifacts. I don't understand why that happens, but forcing a layout fixes it. I've scoped this just to chrome os for now. BUG=27898 TEST=make sure tab switching on chrome os doesn't result in any visual artifacts, especially when switching between ntp and non-ntp. Review URL: http://codereview.chromium.org/397018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32152 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index bf41098..d0f1cf0 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -311,6 +311,10 @@ void BookmarkBarGtk::Show(bool animate) {
}
void BookmarkBarGtk::Hide(bool animate) {
+#if defined(OS_CHROMEOS)
+ bool was_floating = floating_;
+#endif
+
UpdateFloatingState();
// After coming out of fullscreen, the browser window sets the bookmark bar
@@ -324,6 +328,19 @@ void BookmarkBarGtk::Hide(bool animate) {
gtk_widget_hide(bookmark_hbox_);
slide_animation_->Reset(0);
AnimationProgressed(slide_animation_.get());
+
+#if defined(OS_CHROMEOS)
+ if (floating_ != was_floating) {
+ // For some reason when switching between ntp and non-ntp (and other
+ // similar scenarios) the bookmark bar gets layed out a size of 1x1 and we
+ // get painting artifacts across the top of the window. By forcing a
+ // layout now we ensure the bookmark bar isn't sized to 1x1. This may not
+ // be specific to chromeos, but that's how we're scoping it for now.
+ GtkWidget* parent = gtk_widget_get_parent(widget());
+ if (parent)
+ gtk_widget_size_allocate(parent, &parent->allocation);
+ }
+#endif
}
}