diff options
author | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-12 22:17:18 +0000 |
---|---|---|
committer | evanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-12 22:17:18 +0000 |
commit | 13a8adfee148682b7f9489e34c428b37f465675d (patch) | |
tree | 10eed3e2a5460626defd8dafd62db4eec9412563 | |
parent | 9a3a82b02752108598f46a562f9c2b7528d858d4 (diff) | |
download | chromium_src-13a8adfee148682b7f9489e34c428b37f465675d.zip chromium_src-13a8adfee148682b7f9489e34c428b37f465675d.tar.gz chromium_src-13a8adfee148682b7f9489e34c428b37f465675d.tar.bz2 |
Fix test_shell resizing.
Gtk sizing happens in two passes: first, each widget requests a size, then
the containers recursively allocate how much space each child widget gets.
For the WebView, we want to request no space (so that we can be resized
as small as possible) and when computing our actual size we want to use
our allocated size, not our requested size.
Review URL: http://codereview.chromium.org/10659
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5309 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/tools/test_shell/gtk/webwidget_host.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/webkit/tools/test_shell/gtk/webwidget_host.cc b/webkit/tools/test_shell/gtk/webwidget_host.cc index 5700fca..d469798 100644 --- a/webkit/tools/test_shell/gtk/webwidget_host.cc +++ b/webkit/tools/test_shell/gtk/webwidget_host.cc @@ -21,7 +21,6 @@ namespace { gboolean ConfigureEvent(GtkWidget* widget, GdkEventConfigure* config, WebWidgetHost* host) { - DLOG(INFO) << " -- Resize " << config->width << " " << config->height; host->Resize(gfx::Size(config->width, config->height)); return FALSE; } @@ -179,13 +178,12 @@ void WebWidgetHost::Resize(const gfx::Size &newsize) { // The pixel buffer backing us is now the wrong size canvas_.reset(); - gtk_widget_set_size_request(GTK_WIDGET(view_), newsize.width(), newsize.height()); webwidget_->Resize(gfx::Size(newsize.width(), newsize.height())); } void WebWidgetHost::Paint() { - gint width, height; - gtk_widget_get_size_request(GTK_WIDGET(view_), &width, &height); + int width = view_->allocation.width; + int height = view_->allocation.height; gfx::Rect client_rect(width, height); // Allocate a canvas if necessary |