22// All rights reserved. Licensed under BSD 3-clause license.
33// Project website: https://github.com/cztomczak/cefpython
44
5+ // NOTE: This file is also used by "subprocess" and "libcefpythonapp"
6+ // targets during build.
7+
58#include " x11.h"
69#include " include/base/cef_logging.h"
710
@@ -24,6 +27,7 @@ void InstallX11ErrorHandlers() {
2427 // Copied from upstream cefclient.
2528 // Install xlib error handlers so that the application won't be terminated
2629 // on non-fatal errors. Must be done after initializing GTK.
30+ LOG (INFO) << " [Browser process] Install X11 error handlers" ;
2731 XSetErrorHandler (XErrorHandlerImpl);
2832 XSetIOErrorHandler (XIOErrorHandlerImpl);
2933}
@@ -48,6 +52,7 @@ void SetX11WindowTitle(CefRefPtr<CefBrowser> browser, char* title) {
4852}
4953
5054GtkWindow* CefBrowser_GetGtkWindow (CefRefPtr<CefBrowser> browser) {
55+ // TODO: Should return NULL when using the Views framework
5156 // -- REWRITTEN FOR CEF PYTHON USE CASE --
5257 // X11 window handle
5358 ::Window xwindow = browser->GetHost ()->GetWindowHandle ();
@@ -68,6 +73,10 @@ GtkWindow* CefBrowser_GetGtkWindow(CefRefPtr<CefBrowser> browser) {
6873 // internally, so GTK wasn't yet initialized and must do it
6974 // now, so that display is available. Also must install X11
7075 // 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.
7180 LOG (INFO) << " [Browser process] Initialize GTK" ;
7281 gtk_init (0 , NULL );
7382 InstallX11ErrorHandlers ();
0 commit comments