Index: chrome/common/gtk_util.cc |
=================================================================== |
--- chrome/common/gtk_util.cc (revision 34134) |
+++ chrome/common/gtk_util.cc (working copy) |
@@ -96,6 +96,22 @@ |
std::map<GdkCursorType, GdkCursor*> cursor_cache_; |
}; |
+// Expose event handler for a container that simply suppresses the default |
+// drawing and propagates the expose event to the container's children. |
+gboolean PaintNoBackground(GtkWidget* widget, |
+ GdkEventExpose* event, |
+ gpointer unused) { |
+ GList* children = gtk_container_get_children(GTK_CONTAINER(widget)); |
+ for (GList* item = children; item; item = item->next) { |
+ gtk_container_propagate_expose(GTK_CONTAINER(widget), |
+ GTK_WIDGET(item->data), |
+ event); |
+ } |
+ g_list_free(children); |
+ |
+ return TRUE; |
+} |
+ |
} // namespace |
namespace event_utils { |
@@ -619,4 +635,9 @@ |
} |
} |
+void SuppressDefaultPainting(GtkWidget* container) { |
+ g_signal_connect(container, "expose-event", |
+ G_CALLBACK(PaintNoBackground), NULL); |
+} |
+ |
} // namespace gtk_util |