CEF views and CreateBrowserSync

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

CEF views and CreateBrowserSync

Postby Czarek » Sat Mar 25, 2017 4:47 am

I am trying to integrate CEF views with my existing code. I have a hello world example in cefpython that doesn't depend on any third party GUI framework and calls CefWindowInfo.SetAsChild(0) so that CEF creates a top-level window. However that window has no title, so I wanted to use CEF views to set title. However I can't get it to work, I get a blank window, browser loads fine, but is not shown. Here is my code:

Code: Select all
cef_window = CefWindow::CreateTopLevelWindow()
window_info->SetAsChild(cef_window->GetWindowHandle())


Tried calling SetBounds, Layout and SetToFillLayout without success.

I see that there is CefBrowserView::CreateBrowserView() method, however it creates browser asynchronously and I want to integrate with existing code that expects synchronous browser creation.

Update:
I printed CefBrowser window handle and then executed:
Code: Select all
xdotool windowraise 65011770

And then I see browser just fine.

CEF branch 2924.
OS: Ubuntu 14.04
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am

Re: CEF views and CreateBrowserSync

Postby magreenblatt » Sat Mar 25, 2017 10:37 am

You must use CreateBrowserView with views. See example usage in cefclient or cefsimple.
magreenblatt
Site Admin
 
Posts: 12382
Joined: Fri May 29, 2009 6:57 pm

Re: CEF views and CreateBrowserSync

Postby Czarek » Sat Mar 25, 2017 11:28 am

Thanks. I ended up calling native Cocoa/X11 functions to set title. On Windows SetAsPopup() already supports setting title.
Maintainer of the CEF Python, PHP Desktop and CEF C API projects. My LinkedIn.
User avatar
Czarek
Virtuoso
 
Posts: 1927
Joined: Sun Nov 06, 2011 2:12 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 38 guests