summaryrefslogtreecommitdiffstats
path: root/views/controls/native
diff options
context:
space:
mode:
authorscottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-20 22:33:51 +0000
committerscottbyer@chromium.org <scottbyer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-20 22:33:51 +0000
commit101747a964502501506c2903983b14b2e741d230 (patch)
tree0e952fa7ca99fb91dbfa58982afe49076d5d0464 /views/controls/native
parentc6a7b86c54d8b920943c97d990268ba1aee7b04b (diff)
downloadchromium_src-101747a964502501506c2903983b14b2e741d230.zip
chromium_src-101747a964502501506c2903983b14b2e741d230.tar.gz
chromium_src-101747a964502501506c2903983b14b2e741d230.tar.bz2
Add in a browser test for dialog resizing, which was catching an issue with the way we were using GTK in toolkit views. Possibly related to 27365 or 38785.
http://code.google.com/p/chromium-os/issues/detail?id=4126 BUG=chromium-os:4126 TEST=HtmlDialogBrowserTest.SizeWindow Review URL: http://codereview.chromium.org/2768006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56919 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/native')
-rw-r--r--views/controls/native/native_view_host_gtk.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/views/controls/native/native_view_host_gtk.cc b/views/controls/native/native_view_host_gtk.cc
index 79a144d..2ba10b8 100644
--- a/views/controls/native/native_view_host_gtk.cc
+++ b/views/controls/native/native_view_host_gtk.cc
@@ -10,6 +10,7 @@
#include "base/logging.h"
#include "views/controls/native/native_view_host.h"
#include "views/focus/focus_manager.h"
+#include "views/widget/gtk_views_fixed.h"
#include "views/widget/widget_gtk.h"
namespace views {
@@ -228,13 +229,16 @@ void NativeViewHostGtk::ShowWidget(int x, int y, int w, int h) {
fixed_h = std::min(installed_clip_bounds_.height(), h);
}
+ // Don't call gtk_widget_size_allocate now, as we're possibly in the
+ // middle of a re-size, and it kicks off another re-size, and you
+ // get flashing. Instead, we'll set the desired size as properties
+ // on the widget and queue the re-size.
+ gtk_views_fixed_set_widget_size(host_->native_view(), child_w, child_h);
+ gtk_fixed_move(GTK_FIXED(fixed_), host_->native_view(), child_x, child_y);
+
// Size and place the fixed_.
GetHostWidget()->PositionChild(fixed_, fixed_x, fixed_y, fixed_w, fixed_h);
- // Size and place the hosted NativeView.
- gtk_widget_set_size_request(host_->native_view(), child_w, child_h);
- gtk_fixed_move(GTK_FIXED(fixed_), host_->native_view(), child_x, child_y);
-
gtk_widget_show(fixed_);
gtk_widget_show(host_->native_view());
}
@@ -272,7 +276,7 @@ void NativeViewHostGtk::CreateFixed(bool needs_window) {
DestroyFixed();
- fixed_ = gtk_fixed_new();
+ fixed_ = gtk_views_fixed_new();
gtk_widget_set_name(fixed_, "views-native-view-host-fixed");
gtk_fixed_set_has_window(GTK_FIXED(fixed_), needs_window);
// Defeat refcounting. We need to own the fixed.