See this topic on the CEF C++ forum for more details:
http://www.magpcss.org/ceforum/viewtopic.php?f=6&t=10641
Do the following changes in the CEF C++ sources:
1. In `chromium/src/cef/libcef/browser/browser_host_impl_gtk.cc`:
At the end of the CefBrowserHostImpl::PlatformCreateWindow() function,
before the return statement add the following code:
gtk_widget_show_all(GTK_WIDGET(window_info_.widget));
In the same function replace this code:
gtk_container_add(GTK_CONTAINER(window_info_.parent_widget),
window_info_.widget);
With the following code:
if (GTK_IS_BOX(window_info_.parent_widget)) {
gtk_box_pack_start(GTK_BOX(window_info_.parent_widget),
window_info_.widget, TRUE, TRUE, 0);
} else {
// Parent view shouldn't contain any children, but in wxWidgets library
// there will be GtkPizza widget for Panel or any other control.
GList *children, *iter;
children = gtk_container_get_children(GTK_CONTAINER(
window_info_.parent_widget));
GtkWidget* child = NULL;
GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
for (iter = children; iter != NULL; iter = g_list_next(iter)) {
child = GTK_WIDGET(iter->data);
// We will have to keep a reference to that child that we remove,
// otherwise we will get lots of warnings like "invalid unclassed
// pointer in cast to `GtkPizza'". First we increase a reference,
// we need to do this for a moment before we add this child to the
// vbox, then we will decrease that reference.
g_object_ref(G_OBJECT(child));
gtk_container_remove(GTK_CONTAINER(window_info_.parent_widget), child);
}
g_list_free(children);
gtk_box_pack_start(GTK_BOX(vbox), window_info_.widget, TRUE, TRUE, 0);
if (child != NULL) {
// This child is packed to the box only so that its reference lives,
// as it might be referenced from other code thus resulting in errors.
gtk_box_pack_end(GTK_BOX(vbox), child, FALSE, FALSE, 0);
gtk_widget_hide(GTK_WIDGET(child));
g_object_unref(G_OBJECT(child));
}
gtk_widget_show(GTK_WIDGET(vbox));
if (GTK_IS_SCROLLED_WINDOW(window_info_.parent_widget))
gtk_scrolled_window_add_with_viewport(
GTK_SCROLLED_WINDOW(window_info_.parent_widget), vbox);
else
gtk_container_add(GTK_CONTAINER(window_info_.parent_widget), vbox);
}