diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 01:57:58 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-21 01:57:58 +0000 |
commit | 9293f24476481c51ea0d4804a8c8db7888f02d93 (patch) | |
tree | a307b5eb209a13e200f6d2a4d8b6d793c50647cc /chrome/browser/gtk/tab_contents_container_gtk.cc | |
parent | 7753518221d970398c094e977ba2e266c25284f7 (diff) | |
download | chromium_src-9293f24476481c51ea0d4804a8c8db7888f02d93.zip chromium_src-9293f24476481c51ea0d4804a8c8db7888f02d93.tar.gz chromium_src-9293f24476481c51ea0d4804a8c8db7888f02d93.tar.bz2 |
Don't get stuck in an allocate loop on closing the download shelf.
Review URL: http://codereview.chromium.org/113674
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tab_contents_container_gtk.cc')
-rw-r--r-- | chrome/browser/gtk/tab_contents_container_gtk.cc | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/gtk/tab_contents_container_gtk.cc b/chrome/browser/gtk/tab_contents_container_gtk.cc index 02f635f..b05070b 100644 --- a/chrome/browser/gtk/tab_contents_container_gtk.cc +++ b/chrome/browser/gtk/tab_contents_container_gtk.cc @@ -14,11 +14,15 @@ namespace { // Allocates all normal tab contents views to the size of the passed in // |allocation|. Ignores StatusBubbles, which are handled separately. -void ChildrenSizeAllocate(GtkWidget* widget, void* param) { +void ResizeChildren(GtkWidget* widget, void* param) { GtkAllocation* allocation = reinterpret_cast<GtkAllocation*>(param); if (strcmp(gtk_widget_get_name(widget), "status-bubble") != 0) { - gtk_widget_size_allocate(widget, allocation); + if (widget->allocation.width != allocation->width || + widget->allocation.height != allocation->height) { + gtk_widget_set_size_request(widget, allocation->width, + allocation->height); + } } } @@ -158,8 +162,7 @@ void TabContentsContainerGtk::OnFixedSizeAllocate( GtkAllocation* allocation, TabContentsContainerGtk* container) { // Set all the tab contents GtkWidgets to the size of the allocation. - gtk_container_foreach(GTK_CONTAINER(fixed), ChildrenSizeAllocate, - allocation); + gtk_container_foreach(GTK_CONTAINER(fixed), ResizeChildren, allocation); // Tell the status bubble about how large it can be. container->status_bubble_->SetParentAllocation(fixed, allocation); |