summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-09 19:10:26 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-09 19:10:26 +0000
commitea1771720662c3fdcf8a26c4d99fd3ce57fc0415 (patch)
tree74721b7b408eafb1adbf2fe0005e98b09b8da161 /views
parent52ebf2b46daaddbc67e05d61f7dcee46625de5f0 (diff)
downloadchromium_src-ea1771720662c3fdcf8a26c4d99fd3ce57fc0415.zip
chromium_src-ea1771720662c3fdcf8a26c4d99fd3ce57fc0415.tar.gz
chromium_src-ea1771720662c3fdcf8a26c4d99fd3ce57fc0415.tar.bz2
Fixes bug in changing to side tabs that could result in making window
bigger. When you switch to side tabs we end up in a situations where if you ask for the computed requested size you'll get a larger value than the current bounds of the window. Gtk sees this and sizes the window. We really don't want to derive the requested size of WidgetGtk when used a window from the contents, instead we want it to be empty or use an explicitly set value. BUG=53654 TEST=see bug Review URL: http://codereview.chromium.org/3300023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58972 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_gtk.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 67d542f..dfa9a2f 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -1432,6 +1432,17 @@ void WidgetGtk::CreateGtkWidget(GtkWidget* parent, const gfx::Rect& bounds) {
gtk_window_set_transient_for(GTK_WINDOW(widget_), GTK_WINDOW(parent));
GTK_WIDGET_UNSET_FLAGS(widget_, GTK_DOUBLE_BUFFERED);
+ // Gtk determines the size for windows based on the requested size of the
+ // child. For WidgetGtk the child is a fixed. If the fixed ends up with a
+ // child widget it's possible the child widget will drive the requested size
+ // of the widget, which we don't want. We explicitly set a value of 1x1 here
+ // so that gtk doesn't attempt to resize the window if we end up with a
+ // situation where the requested size of a child of the fixed is greater
+ // than the size of the window. By setting the size in this manner we're
+ // also allowing users of WidgetGtk to change the requested size at any
+ // time.
+ gtk_widget_set_size_request(widget_, 1, 1);
+
if (!bounds.size().IsEmpty()) {
// When we realize the window, the window manager is given a size. If we
// don't specify a size before then GTK defaults to 200x200. Specify