Alright. I've found an error within my own GTK code. I'm just still confused how CEF was catching and redirecting those errors to the console as if it was comming from CEF...
Anyway, I'm still getting the following errors:
- Code: Select all
[1219/140601.888881:FATAL:cef_ref_counted.h(325)] Assert failed: ptr_ != __null.
[1219/140601.894259:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
[1219/140601.902136:ERROR:gl_surface_egl.cc(773)] EGL Driver message (Error) eglCreateWindowSurface: Bad native window.
[1219/140601.902241:ERROR:gl_surface_egl.cc(1443)] eglCreateWindowSurface failed with error EGL_BAD_NATIVE_WINDOW
[1219/140601.905347:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
[1219/140601.905608:WARNING:ipc_message_attachment_set.cc(49)] MessageAttachmentSet destroyed with unconsumed attachments: 0/1
[1219/140601.906561:ERROR:x11_software_bitmap_presenter.cc(134)] XGetWindowAttributes failed for window 94371848
What seems interresting is that the X window handle I give to CefWindowInfo::SetAsChild is different than 94371848.
What also seems weird is that I make one call to CefBrowserHost::CreateBrowser, causes two calls to be made to CefApp::OnBrowserCreated.
I've been looking at cefclient, and also what the PR changed about it. However, I'm currently only interrested at the standard browser implementation, not the OSR version. It seems rather straightforward, however, I seem to run in problems nevertheless.
Here is some code of mine that constructs the GTK window:
- Code: Select all
//GtkWidget* gtk_handle = gtk_application_window_new( window->app->impl.handle );
GtkWidget* gtk_handle = gtk_window_new( GTK_WINDOW_TOPLEVEL );
gtk_widget_hide_on_delete( gtk_handle );
if ( window->parent != 0 ) {
gtk_widget_set_parent_window( gtk_handle, GDK_WINDOW( window->parent->impl.handle ) );
gtk_window_set_destroy_with_parent( GTK_WINDOW(gtk_handle), FALSE );
}
// Title
gchar* title = bw_string_copyAsNewCstr( _title );
gtk_window_set_title( GTK_WINDOW(gtk_handle), title );
free( title );
if ( width != -1 || height != -1 ) {
if ( width < 1 )
width = 800;
if ( height < 1 )
height = 600;
// Width and height
gtk_window_resize( GTK_WINDOW(gtk_handle), width, height );
}
gtk_window_set_resizable( GTK_WINDOW(gtk_handle), options->resizable );
gtk_application_add_window( window->app->impl.handle, GTK_WINDOW(gtk_handle) );
gtk_widget_realize( gtk_handle );
and here is some code of mine that tries to embed CEF into the window (the GtkWidget* handle is now accessible through bw->window->impl.handle):
- Code: Select all
gtk_widget_show_all( bw->window->impl.handle );
GdkWindow* gdk_window = gtk_widget_get_window( bw->window->impl.handle );
Window x_window = GDK_WINDOW_XID( gdk_window );
CefRect rect( 0, 0, width, height );
info.SetAsChild( x_window, rect );
Also, I'm pretty confident that all other CEF code is fine, since it seems to work on Windows with win32 code.
On my linux system, I'm just getting an empty GTK window though.