diff options
author | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-25 20:16:27 +0000 |
---|---|---|
committer | scottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-25 20:16:27 +0000 |
commit | 81bddb46199153e3cac53888aff46991eeafcfb8 (patch) | |
tree | 9e39d40b5b93b9ce646ed91ee8e7533d377f56ac /views | |
parent | 8ad72d593603097cc468e5c308db81aa26613fff (diff) | |
download | chromium_src-81bddb46199153e3cac53888aff46991eeafcfb8.zip chromium_src-81bddb46199153e3cac53888aff46991eeafcfb8.tar.gz chromium_src-81bddb46199153e3cac53888aff46991eeafcfb8.tar.bz2 |
Fix regression caused by http://codereview.chromium.org/2768006/show
Using the new preferred size attributes for non-GtkViewsFixed widgets
won't do very much. Put the gtk_widget_size_allocation call back for
those widgets. Add in a small check into the ScreenLockerTest.TestBasic to prevent any future such regression.
BUG=chromium-os:5987
TEST=ScreenLockerTest.TestBasic
Review URL: http://codereview.chromium.org/3181039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57373 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index f74eef13..0a129f6 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -1413,6 +1413,15 @@ void WidgetGtk::CreateGtkWidget(GtkWidget* parent, const gfx::Rect& bounds) { DCHECK(GTK_WIDGET_REALIZED(widget_)); gdk_window_set_composited(widget_->window, true); } + if (!bounds.size().IsEmpty()) { + // Make sure that an widget is given it's initial size before + // we're done initializing, to take care of some potential + // corner cases when programmatically arranging hierarchies as + // seen in + // http://code.google.com/p/chromium-os/issues/detail?id=5987 + GtkAllocation alloc = { 0, 0, bounds.width(), bounds.height() }; + gtk_widget_size_allocate(widget_, &alloc); + } } else { // Use our own window class to override GtkWindow's move_focus method. widget_ = gtk_views_window_new( |