summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tabs
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk/tabs')
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_gtk.cc8
-rw-r--r--chrome/browser/gtk/tabs/dragged_tab_gtk.h4
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_;