@@ -5,50 +5,52 @@ Do the following changes in the CEF C++ sources:
55
661. In `chromium/src/cef/libcef/browser/browser_host_impl_gtk.cc`:
77
8- At the end of the CefBrowserImpl::UIT_CreateBrowser () function,
8+ At the end of the CefBrowserHostImpl::PlatformCreateWindow () function,
99 before the return statement add the following code:
1010
11- gtk_widget_show_all(GTK_WIDGET(window_info_.widget));
11+ gtk_widget_show_all(GTK_WIDGET(window_info_.widget));
1212
13- 2. In `chromium/src/cef/libcef/webwidget_host_gtk.cc` :
13+ In the same function replace this code :
1414
15- In WebWidgetHostGtkWidget::CreateNewWidget() function replace this line:
16-
17- gtk_box_pack_start(GTK_BOX(parent_view), widget, TRUE, TRUE, 0);
15+ gtk_container_add(GTK_CONTAINER(window_info_.parent_widget),
16+ window_info_.widget);
1817
1918 With the following code:
2019
21- if (GTK_IS_BOX(parent_view)) {
22- gtk_box_pack_start(GTK_BOX(parent_view), widget, TRUE, TRUE, 0);
23- } else {
24- // Parent view shouldn't contain any children, but in wxWidgets library
25- // there will be GtkPizza widget for Panel or any other control.
26- GList *children, *iter;
27- children = gtk_container_get_children(GTK_CONTAINER(parent_view));
28- GtkWidget* child = NULL;
29- GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
30- for (iter = children; iter != NULL; iter = g_list_next(iter)) {
31- child = GTK_WIDGET(iter->data);
32- // We will have to keep a reference to that child that we remove,
33- // otherwise we will get lots of warnings like "invalid unclassed
34- // pointer in cast to `GtkPizza'". First we increase a reference,
35- // we need to do this for a moment before we add this child to the
36- // vbox, then we will decrease that reference.
37- g_object_ref(G_OBJECT(child));
38- gtk_container_remove(GTK_CONTAINER(parent_view), child);
39- }
40- g_list_free(children);
41- gtk_box_pack_start(GTK_BOX(vbox), widget, TRUE, TRUE, 0);
42- if (child != NULL) {
43- // This child is packed to the box only so that its reference lives,
44- // as it might be referenced from other code thus resulting in errors.
45- gtk_box_pack_end(GTK_BOX(vbox), child, FALSE, FALSE, 0);
46- gtk_widget_hide(GTK_WIDGET(child));
47- g_object_unref(G_OBJECT(child));
48- }
49- gtk_widget_show(GTK_WIDGET(vbox));
50- if (GTK_IS_SCROLLED_WINDOW(parent_view))
51- gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(parent_view), vbox);
52- else
53- gtk_container_add(GTK_CONTAINER(parent_view), vbox);
20+ if (GTK_IS_BOX(window_info_.parent_widget)) {
21+ gtk_box_pack_start(GTK_BOX(window_info_.parent_widget),
22+ window_info_.widget, TRUE, TRUE, 0);
23+ } else {
24+ // Parent view shouldn't contain any children, but in wxWidgets library
25+ // there will be GtkPizza widget for Panel or any other control.
26+ GList *children, *iter;
27+ children = gtk_container_get_children(GTK_CONTAINER(
28+ window_info_.parent_widget));
29+ GtkWidget* child = NULL;
30+ GtkWidget* vbox = gtk_vbox_new(FALSE, 0);
31+ for (iter = children; iter != NULL; iter = g_list_next(iter)) {
32+ child = GTK_WIDGET(iter->data);
33+ // We will have to keep a reference to that child that we remove,
34+ // otherwise we will get lots of warnings like "invalid unclassed
35+ // pointer in cast to `GtkPizza'". First we increase a reference,
36+ // we need to do this for a moment before we add this child to the
37+ // vbox, then we will decrease that reference.
38+ g_object_ref(G_OBJECT(child));
39+ gtk_container_remove(GTK_CONTAINER(window_info_.parent_widget), child);
40+ }
41+ g_list_free(children);
42+ gtk_box_pack_start(GTK_BOX(vbox), window_info_.widget, TRUE, TRUE, 0);
43+ if (child != NULL) {
44+ // This child is packed to the box only so that its reference lives,
45+ // as it might be referenced from other code thus resulting in errors.
46+ gtk_box_pack_end(GTK_BOX(vbox), child, FALSE, FALSE, 0);
47+ gtk_widget_hide(GTK_WIDGET(child));
48+ g_object_unref(G_OBJECT(child));
5449 }
50+ gtk_widget_show(GTK_WIDGET(vbox));
51+ if (GTK_IS_SCROLLED_WINDOW(window_info_.parent_widget))
52+ gtk_scrolled_window_add_with_viewport(
53+ GTK_SCROLLED_WINDOW(window_info_.parent_widget), vbox);
54+ else
55+ gtk_container_add(GTK_CONTAINER(window_info_.parent_widget), vbox);
56+ }
0 commit comments