diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:10:42 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-23 00:10:42 +0000 |
commit | a3c72a0e38b8d56680d602fd695f1daf8e9aa719 (patch) | |
tree | c77c5587eae7f5e1577a48bc3de79f502679de24 /chrome/browser/gtk | |
parent | d32d46180799e50f74d8b27fc1e5ab1454dbcef0 (diff) | |
download | chromium_src-a3c72a0e38b8d56680d602fd695f1daf8e9aa719.zip chromium_src-a3c72a0e38b8d56680d602fd695f1daf8e9aa719.tar.gz chromium_src-a3c72a0e38b8d56680d602fd695f1daf8e9aa719.tar.bz2 |
gtk: Fix a regression from r21320 which caused a crash when dragging a tab out of the browser. We must wrap the tab renderer widget in a GtkFixed in order to maintain the size we request for the widget; otherwise, the widget will fill the entire window.
BUG=none
TEST=Drag a tab out of the window. This should not crash.
Review URL: http://codereview.chromium.org/155965
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21348 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_gtk.cc | 8 | ||||
-rw-r--r-- | chrome/browser/gtk/tabs/dragged_tab_gtk.h | 4 |
2 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc index 0f0c4f7..2ddb607 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.cc +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.cc @@ -60,7 +60,13 @@ DraggedTabGtk::DraggedTabGtk(TabContents* datasource, g_signal_connect(G_OBJECT(container_), "expose-event", G_CALLBACK(OnExposeEvent), this); gtk_widget_add_events(container_, GDK_STRUCTURE_MASK); - gtk_container_add(GTK_CONTAINER(container_), renderer_->widget()); + + // We contain the tab renderer in a GtkFixed in order to maintain the + // requested size. Otherwise, the widget will fill the entire window and + // cause a crash when rendering because the bounds don't match our images. + fixed_ = gtk_fixed_new(); + gtk_fixed_put(GTK_FIXED(fixed_), renderer_->widget(), 0, 0); + gtk_container_add(GTK_CONTAINER(container_), fixed_); gtk_widget_show_all(container_); } diff --git a/chrome/browser/gtk/tabs/dragged_tab_gtk.h b/chrome/browser/gtk/tabs/dragged_tab_gtk.h index c88c10b..0057705 100644 --- a/chrome/browser/gtk/tabs/dragged_tab_gtk.h +++ b/chrome/browser/gtk/tabs/dragged_tab_gtk.h @@ -118,6 +118,10 @@ class DraggedTabGtk : public AnimationDelegate { // The window that contains the dragged tab or tab contents. GtkWidget* container_; + // The fixed widget that we use to contain the tab renderer so that the + // tab widget won't be resized. + GtkWidget* fixed_; + // The native view of the tab contents. GtkWidget* contents_; |