diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-24 20:27:47 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-24 20:27:47 +0000 |
commit | 05c6bcf466f08a0bea39fea32bbe9b741ec8d4c5 (patch) | |
tree | 8a43d6c09bff22dfb3bbe8253b7d1677f349f7b6 /chrome/browser/gtk/slide_animator_gtk.cc | |
parent | f6d1d6ebe485a9e4523d652eaee2f14178211ddd (diff) | |
download | chromium_src-05c6bcf466f08a0bea39fea32bbe9b741ec8d4c5.zip chromium_src-05c6bcf466f08a0bea39fea32bbe9b741ec8d4c5.tar.gz chromium_src-05c6bcf466f08a0bea39fea32bbe9b741ec8d4c5.tar.bz2 |
Avoid setting a widget's allocation outside of a widget implementation.
GtkFixeds do allocate their children. They give them an allocation that matches
their size request. Hence when you directly allocate the child, it gets two
allocates right in a row (one from you, one from the fixed). This was causing
flicker in slide animator gtk (most noticeable when opening a new browser window
and seeing the restore infobar, but also confirmed with debugging statements). The original reason for needing to use
size_allocate() instead of set_size_request() (which had to do with browser
window resizing) is now obsolete, so revert these back to size_request()s.
BUG=none
TEST=less flicker when an infobar is opening; border at bottom of toolbar/bookmark bar still looks the same
Review URL: http://codereview.chromium.org/147100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19164 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/slide_animator_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/slide_animator_gtk.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/chrome/browser/gtk/slide_animator_gtk.cc b/chrome/browser/gtk/slide_animator_gtk.cc index cea09b6..d978316 100644 --- a/chrome/browser/gtk/slide_animator_gtk.cc +++ b/chrome/browser/gtk/slide_animator_gtk.cc @@ -13,13 +13,9 @@ namespace { void OnFixedSizeAllocate(GtkWidget* fixed, GtkAllocation* allocation, GtkWidget* child) { - if (allocation->width != child->allocation.width) { - // The size of the GtkFixed has changed. We want |child_| to match widths, - // but the height should not change. - GtkAllocation new_allocation = child->allocation; - new_allocation.width = allocation->width; - gtk_widget_size_allocate(child, &new_allocation); - } + // The size of the GtkFixed has changed. We want |child_| to match widths, + // but the height should not change. + gtk_widget_set_size_request(child, allocation->width, -1); } } // namespace |