Can I use WindowPopup Browser in OSR Mode ?

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.

Can I use WindowPopup Browser in OSR Mode ?

Postby mung » Thu Jul 26, 2018 12:00 am

Hi ~
Can I use WindowPopup Browser in OSR Mode?

cef version : 3.3071.1634.g9cc59c8 (64bit)

I developing a game with CEF3 OSR Mode in window 7.
And I want to draw some page in my game. I succeeded that.
However, I can't draw PopupWindow in OSR Mode.
I found "// Windowless rendering is not supported." this comment in "root_window_views.cc" file.

I want to ask about it. Isn't supported to draw popup window in OSR Mode?

And, For use popup window, must I create a window?

I don't want to lost device when CEF draws popup window in my game Fullscreen Mode.

Is it possible?

Thank you :)
mung
Mentor
 
Posts: 58
Joined: Wed Jan 04, 2017 12:20 am

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby magreenblatt » Thu Jul 26, 2018 10:23 am

Views is unrelated to OSR. OSR popups can be implemented by returning a CefClient in CefLifeSpanHandler::OnBeforePopup that implements CefRenderHandler.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby mung » Sun Jul 29, 2018 7:03 pm

magreenblatt wrote:Views is unrelated to OSR. OSR popups can be implemented by returning a CefClient in CefLifeSpanHandler::OnBeforePopup that implements CefRenderHandler.


Thank you for your answer.:)

I tried this.

Code: Select all
// Comment is what I tried things.
bool CefBrowserInstanc::?OnBeforePopup( browser, frame, url, frameName, disposition, usergesture, popupfeature, windowinfo, client, settings, nojavascriptaccess)
{
// client = this; // client value is already this class before binding this class.
HWND hWnd = GetWindowHwnd();
windowInfo.SetAsWindowless(hWnd);

CefRefPtr<CefFrame> mainFrame = m_pBrowserTemp->GetBrowset()->GetMainFrame();
if(nullptr == mainFrame.get()) { return FALSE;}
mainFrame->LoadURL(target_url);

// disposition = WOD_CURRNET_TAB;

// return CefLifeSpanHandler::OnBeforePopup(browser, ...... );
return false;
}


1, Just doing returning false in OnBeforePopup Function and open the URL with created other browser? Is this right?

If I wrong, can I get some example about OnBeforePopup and explanation of DispositionsFlag?

2, what kind of I change the DispositionsFlag?
Is it fine, skip changing DispositionsFlag?

Thank you :)
mung
Mentor
 
Posts: 58
Joined: Wed Jan 04, 2017 12:20 am

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby magreenblatt » Sun Jul 29, 2018 8:44 pm

What are you trying to do?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby mung » Sun Jul 29, 2018 9:58 pm

magreenblatt wrote:What are you trying to do?


Just I want to draw PopupWindow by OSRMode.
mung
Mentor
 
Posts: 58
Joined: Wed Jan 04, 2017 12:20 am

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby mung » Sun Jul 29, 2018 11:43 pm

magreenblatt wrote:What are you trying to do?


When I happened LostedDevice(minimized Window) in My d3d Project FullscreenMode I couldn't send MouseMessageEvent to PopupWindow.
So, I tried to draw in OSRMode.

How can I solve this problem?
mung
Mentor
 
Posts: 58
Joined: Wed Jan 04, 2017 12:20 am

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby magreenblatt » Mon Jul 30, 2018 11:43 am

Do you want to create a new OSR browser for the popup? Or do you want to cancel the popup and load the URL in an existing browser?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby mung » Mon Jul 30, 2018 7:19 pm

magreenblatt wrote:Do you want to create a new OSR browser for the popup? Or do you want to cancel the popup and load the URL in an existing browser?


Is it possible both?
Could you tell me about both?
I want to try both.

Thank you :)
mung
Mentor
 
Posts: 58
Joined: Wed Jan 04, 2017 12:20 am

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby magreenblatt » Tue Jul 31, 2018 12:44 pm

Both are possible.

In both cases you must implement the CefLifeSpanHandler::OnBeforePopup method. Assign your popup's CefClient implementation to |client| and call SetAsWindowless on |windowInfo|. The client must implement CefRenderHandler. You can create the popup initially hidden if you do not want to show it.

In CefRequestHandler::OnBeforeBrowse you can retrieve the URL that will be loaded. You can close the popup in this method (using CefBrowserHost::CloseBrowser) and instead load the URL in some other existing browser.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Can I use WindowPopup Browser in OSR Mode ?

Postby mung » Mon Aug 06, 2018 9:51 pm

magreenblatt wrote:Both are possible.

In both cases you must implement the CefLifeSpanHandler::OnBeforePopup method. Assign your popup's CefClient implementation to |client| and call SetAsWindowless on |windowInfo|. The client must implement CefRenderHandler. You can create the popup initially hidden if you do not want to show it.

In CefRequestHandler::OnBeforeBrowse you can retrieve the URL that will be loaded. You can close the popup in this method (using CefBrowserHost::CloseBrowser) and instead load the URL in some other existing browser.


Thank you for your answer :)
I will try it.
mung
Mentor
 
Posts: 58
Joined: Wed Jan 04, 2017 12:20 am


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 102 guests