Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5353)

Unified Diff: chrome/browser/gtk/tab_contents_drag_source.cc

Issue 3086011: Fix debug build GTK assert in TabContentsDragSource::OnDragBegin(). (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: . Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tab_contents_drag_source.cc
diff --git a/chrome/browser/gtk/tab_contents_drag_source.cc b/chrome/browser/gtk/tab_contents_drag_source.cc
index 8bb4402193ce41cf4ad86c06f242ee249e87e354..a1b5d80f823a27f04d81f9e5e873644f5a65d123 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());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698