2
2
// All rights reserved. Licensed under BSD 3-clause license.
3
3
// Project website: https://github.com/cztomczak/cefpython
4
4
5
+ // NOTE: This file is also used by "subprocess" and "libcefpythonapp"
6
+ // targets during build.
7
+
5
8
#include " x11.h"
6
9
#include " include/base/cef_logging.h"
7
10
@@ -24,6 +27,7 @@ void InstallX11ErrorHandlers() {
24
27
// Copied from upstream cefclient.
25
28
// Install xlib error handlers so that the application won't be terminated
26
29
// on non-fatal errors. Must be done after initializing GTK.
30
+ LOG (INFO) << " [Browser process] Install X11 error handlers" ;
27
31
XSetErrorHandler (XErrorHandlerImpl);
28
32
XSetIOErrorHandler (XIOErrorHandlerImpl);
29
33
}
@@ -48,6 +52,7 @@ void SetX11WindowTitle(CefRefPtr<CefBrowser> browser, char* title) {
48
52
}
49
53
50
54
GtkWindow* CefBrowser_GetGtkWindow (CefRefPtr<CefBrowser> browser) {
55
+ // TODO: Should return NULL when using the Views framework
51
56
// -- REWRITTEN FOR CEF PYTHON USE CASE --
52
57
// X11 window handle
53
58
::Window xwindow = browser->GetHost ()->GetWindowHandle ();
@@ -68,6 +73,10 @@ GtkWindow* CefBrowser_GetGtkWindow(CefRefPtr<CefBrowser> browser) {
68
73
// internally, so GTK wasn't yet initialized and must do it
69
74
// now, so that display is available. Also must install X11
70
75
// error handlers to avoid 'BadWindow' errors.
76
+ // --
77
+ // A similar code is in cefpython_app.cpp and it might already
78
+ // been executed. If making changes here, make changes there
79
+ // as well.
71
80
LOG (INFO) << " [Browser process] Initialize GTK" ;
72
81
gtk_init (0 , NULL );
73
82
InstallX11ErrorHandlers ();
0 commit comments