CefBrowser can't resize

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.

CefBrowser can't resize

Postby chellio » Fri Jun 24, 2016 2:39 pm

Why CefBrowser isn't automatically resized ?
I create CefBrowser in such way, wxPanel is resized because it is placed in sizer.

Code: Select all
...
wxPanel *panel = ...
CefWindowHandle x_handle = gdk_x11_window_get_xid( gtk_widget_get_window(panel->GetHandle()));
cef_wnd_info.SetAsChild( x_handle, CefRect( 0,0, panel->GetClientSize().GetWidth(), panel->GetClientSize().GetHeight()  ) );
...


On resize event:
Code: Select all
...
Singletons::m_mainbrowser->GetHost()->NotifyMoveOrResizeStarted();  //m_mainbrowser is main CefBrowser that I want resize
Singletons::m_mainbrowser->GetHost()->WasResized();
...


But when I resizing top-level window, CefBrowser doesn't resize too, instead black area is left.

Any sugestions?
chellio
Techie
 
Posts: 27
Joined: Fri May 20, 2016 9:26 am
Location: Poland

Re: CefBrowser can't resize

Postby gpbeta » Sat Jun 25, 2016 7:46 am

cef_wnd_info.SetAsChild(x_handle, CefRect) just tell cef to place the render window inside your wxPanel,
so I think you should call
Code: Select all
GTK_RESIZE_API(Singletons::m_mainbrowser->GetHost()->GetWindowHandle());

before notifying resized.
Joshua GPBeta
gpbeta
Newbie
 
Posts: 7
Joined: Thu Jun 23, 2016 2:47 am
Location: China

Re: CefBrowser can't resize

Postby chellio » Sat Jun 25, 2016 9:03 am

GetWindowHandle returns X11 window, I need to find X11 API.
chellio
Techie
 
Posts: 27
Joined: Fri May 20, 2016 9:26 am
Location: Poland


Return to Support Forum

Who is online

Users browsing this forum: finder2, Majestic-12 [Bot] and 55 guests