diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 17:03:12 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-18 17:03:12 +0000 |
commit | 21756fe51178ee6c662f9add3e4c34be9e44c83a (patch) | |
tree | fa08ca0f6596e58f937a6d286bc6c9cbde23e601 /views | |
parent | 1ccf116b017f7a6095c8f15caeae2d5f48db2aef (diff) | |
download | chromium_src-21756fe51178ee6c662f9add3e4c34be9e44c83a.zip chromium_src-21756fe51178ee6c662f9add3e4c34be9e44c83a.tar.gz chromium_src-21756fe51178ee6c662f9add3e4c34be9e44c83a.tar.bz2 |
A long standing bug in views!
Every time a widget is resized, we call Layout on its view hierarchy TWICE!
A while ago, I added code to views::View's default implementation of DidChangeBounds to automatically call Layout. So, after calling SetBounds on a widget, it is not necessary to call Layout. However this is exactly what WidgetWin/WidgetGtk do o_O.
It turns out this doesn't matter on windows because size changes in child widgets never affect the sizes of their parents - they're just clipped to their parent's bounds.
However, on Gtk it seems like sizing a child causes a size-allocate signal to be sent to the parent widget, which means we end up in infinite resize loops.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/131026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18714 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 1 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 1aec6a4..a430de7 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -436,7 +436,6 @@ void WidgetGtk::CreateGtkWidget(GtkWidget* parent) { void WidgetGtk::OnSizeAllocate(GtkWidget* widget, GtkAllocation* allocation) { root_view_->SetBounds(0, 0, allocation->width, allocation->height); - root_view_->Layout(); root_view_->SchedulePaint(); } diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index d4cd460..5cc8a79 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -873,7 +873,6 @@ void WidgetWin::ChangeSize(UINT size_param, const CSize& size) { // Resizing changes the size of the view hierarchy and thus forces a // complete relayout. root_view_->SetBounds(0, 0, rect.Width(), rect.Height()); - root_view_->Layout(); root_view_->SchedulePaint(); if (use_layered_buffer_) |