FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cefpython/patches/issue218_linux.patch at cefpython51 · pythonthings/cefpython · GitHub
pythonthings
cefpython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cefpython
/
patches
/
issue218_linux.patch
Copy path
More file actions
More file actions
Latest commit
History
History
History
58 lines (55 loc) · 2.59 KB
Breadcrumbs
cefpython
/
patches
/
issue218_linux.patch
Copy path
File metadata and controls
58 lines (55 loc) · 2.59 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Index: libcef/browser/browser_host_impl_gtk.cc
===================================================================
--- browser_host_impl_gtk.cc (revision 1639)
+++ browser_host_impl_gtk.cc (working copy)
@@ -273,8 +273,43 @@
// Parent the TabContents to the browser window.
window_info_.widget = web_contents_->GetView()->GetNativeView();
-
gtk_container_add(GTK_CONTAINER(window_info_.parent_widget),
-
window_info_.widget);
+
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);
+
}
g_signal_connect(G_OBJECT(window_info_.widget), "destroy",
G_CALLBACK(browser_destroy), this);
@@ -293,6 +328,8 @@
prefs->inactive_selection_bg_color = SkColorSetRGB(200, 200, 200);
prefs->inactive_selection_fg_color = SkColorSetRGB(50, 50, 50);
+
gtk_widget_show_all(GTK_WIDGET(window_info_.widget));
+
return true;
}
Back
|
FazBrowse Home
|
New Git URL