summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/tab_contents_drag_source.cc
diff options
context:
space:
mode:
authordcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 00:17:13 +0000
committerdcheng@chromium.org <dcheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 00:17:13 +0000
commit952bec23adeaecbd0a22b6970abc1340076f3b23 (patch)
tree6e46ecbcff4b0ed4e426679dbae7a9a822a3c4ec /chrome/browser/gtk/tab_contents_drag_source.cc
parent27538b19124450f43392a965bb080817469f643c (diff)
downloadchromium_src-952bec23adeaecbd0a22b6970abc1340076f3b23.zip
chromium_src-952bec23adeaecbd0a22b6970abc1340076f3b23.tar.gz
chromium_src-952bec23adeaecbd0a22b6970abc1340076f3b23.tar.bz2
Fix debug build GTK assert in TabContentsDragSource::OnDragBegin().
The assert is: Gtk: gtk_widget_set_colormap: assertion `!gtk_widget_get_realized (widget)' failed. BUG=none TEST=Navigate to google.com and drag the logo twice. Review URL: http://codereview.chromium.org/3086011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54851 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/tab_contents_drag_source.cc')
-rw-r--r--chrome/browser/gtk/tab_contents_drag_source.cc11
1 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/gtk/tab_contents_drag_source.cc b/chrome/browser/gtk/tab_contents_drag_source.cc
index 8bb4402..a1b5d80 100644
--- a/chrome/browser/gtk/tab_contents_drag_source.cc
+++ b/chrome/browser/gtk/tab_contents_drag_source.cc
@@ -319,10 +319,13 @@ void TabContentsDragSource::OnDragBegin(GtkWidget* sender,
gdk_pixbuf_get_width(drag_pixbuf_),
gdk_pixbuf_get_height(drag_pixbuf_));
- GdkScreen* screen = gtk_widget_get_screen(drag_icon_);
- GdkColormap* rgba = gdk_screen_get_rgba_colormap(screen);
- if (rgba)
- gtk_widget_set_colormap(drag_icon_, rgba);
+ // We only need to do this once.
+ if (!GTK_WIDGET_REALIZED(drag_icon_)) {
+ GdkScreen* screen = gtk_widget_get_screen(drag_icon_);
+ GdkColormap* rgba = gdk_screen_get_rgba_colormap(screen);
+ if (rgba)
+ gtk_widget_set_colormap(drag_icon_, rgba);
+ }
gtk_drag_set_icon_widget(drag_context, drag_icon_,
image_offset_.x(), image_offset_.y());