summaryrefslogtreecommitdiffstats
path: root/views/widget
diff options
context:
space:
mode:
authorscottbyer@google.com <scottbyer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 18:59:47 +0000
committerscottbyer@google.com <scottbyer@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 18:59:47 +0000
commitfbeec7b0ca0085d379da8672d887d11c4eea0298 (patch)
tree4a8f98428b327bb3b2e65fab2bf0dcdc3895c88a /views/widget
parentdc1a80d7c830a09c8f5281af69fc746a86f558b7 (diff)
downloadchromium_src-fbeec7b0ca0085d379da8672d887d11c4eea0298.zip
chromium_src-fbeec7b0ca0085d379da8672d887d11c4eea0298.tar.gz
chromium_src-fbeec7b0ca0085d379da8672d887d11c4eea0298.tar.bz2
The fix for http://code.google.com/p/chromium-os/issues/detail?id=5987
sets the initial allocation for a widget when a size is passed in to WidgetGtk::Init(). The timing of the init call as part of creating a new tab contents view means that the arrangment of the hierarchy isn't complete yet, so incorrect contents get shown. This goes back to the original behavior which is to ignore the initial size request (it's now ignored at the TabContentsViewGtk::CreateView level instead of being implicitly ignored in the WidgetGtk::Init code). BUG=53870 TEST=Create new tabs, no flash of old tabs seen. Review URL: http://codereview.chromium.org/3290016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59122 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget')
-rw-r--r--views/widget/widget_gtk.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index dfa9a2f..0045a19 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -1413,12 +1413,16 @@ 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()) {
+ if (parent && !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
+
+ // This can't be done without a parent present, or stale data
+ // might show up on the screen as seen in
+ // http://code.google.com/p/chromium/issues/detail?id=53870
GtkAllocation alloc = { 0, 0, bounds.width(), bounds.height() };
gtk_widget_size_allocate(widget_, &alloc);
}