Offscreen rendering produces three windows

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.

Offscreen rendering produces three windows

Postby richeakin » Tue Jan 14, 2014 12:51 am

Hello again and thanks for the help so far,

I'm trying to get offscreen rendering working as in cefclient on windows using a recent release version (tried both 1547 and 1650), which is integrated into an app built with the cinder framework. While I am able to correctly render the browser into an OpenGL texture and display that in my main window, I am also experiencing two other windows being spawned, both of which ramain white and have the words 'Not Responding' in the title. However, when I flip on the CefSettings flag 'single_process = true', I only get the one, main window. Any ideas why this would be?

I have tried setting the CefWindowInfo::SetAsOffscreen() with both NULL and the HWND from my main app's window as the parent window parameter, both with the same result. I'm not sure if it matters, but here is a link to the routine in cinder where the HWND is created.

cheers,
Rich
richeakin
Techie
 
Posts: 21
Joined: Mon Dec 16, 2013 11:50 pm

Re: Offscreen rendering produces three windows

Postby magreenblatt » Tue Jan 14, 2014 9:02 am

CEF creates multiple processes using your executable. See the Tutorial or GeneralUsage wiki pages.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Offscreen rendering produces three windows

Postby richeakin » Tue Jan 14, 2014 12:43 pm

I'm aware that CEF(3) creates multiple processes. What I'm not sure of is why, on windows only, I am getting 3 visible windows instead of one. Granted, it is probably something I don't understand about an application spawning multiple processes on windows, but I don't see any important differences between my application and cef client that would lead to this. Any insights here would be greatly appreciated.

Thanks,
Rich
richeakin
Techie
 
Posts: 21
Joined: Mon Dec 16, 2013 11:50 pm

Re: Offscreen rendering produces three windows

Postby magreenblatt » Tue Jan 14, 2014 1:36 pm

What does your program do if CefExecuteProcess returns >= 0?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Offscreen rendering produces three windows

Postby richeakin » Tue Jan 14, 2014 3:14 pm

Currently I'm asserting that the exitCode returned by CefExecuteProcess is always < 0, hasn't ever hit. Should it? I am calling it right before CefInitialize from the main app's main thread.
richeakin
Techie
 
Posts: 21
Joined: Mon Dec 16, 2013 11:50 pm

Re: Offscreen rendering produces three windows

Postby magreenblatt » Tue Jan 14, 2014 9:01 pm

If you're not using a separate sub-process executable you should exit based on the return value of CefExecuteProcess.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Offscreen rendering produces three windows

Postby richeakin » Wed Jan 15, 2014 6:25 pm

Ah, I understand now. Issue was that I wasn't controlling the main() (or WinMain in this case) function at all - the framework was via a macro. This works on mac because it is using the 'separate sub-process executable' path outlined in the General Usage docs. So, I undid that macro on windows and call CefExectureProcess before the framework makes an application, with the exit logic installed as well. Works great! But it looks like in order to package this up as a proper add-on, I'll have to explore the separate sub-process executable path on windows as well..

By the way, that leaves me with the one 'main' app window, but I still get a debug console popping up - is there any way to disable that? It is always blank.

Cheers and thanks for the clues,
Rich
richeakin
Techie
 
Posts: 21
Joined: Mon Dec 16, 2013 11:50 pm

Re: Offscreen rendering produces three windows

Postby magreenblatt » Wed Jan 15, 2014 7:05 pm

richeakin wrote:By the way, that leaves me with the one 'main' app window, but I still get a debug console popping up - is there any way to disable that? It is always blank.

Using VS2012? If so, it's a bug in Visual Studio. Seems to be fixed in VS2013.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Offscreen rendering produces three windows

Postby richeakin » Wed Jan 15, 2014 8:41 pm

Indeed I am using VS2012, good to know it is fixed in the next version.

Just wanted to note that I went ahead and added the secondary executable and this is working very well for me. Moving on!

cheers,
Rich
richeakin
Techie
 
Posts: 21
Joined: Mon Dec 16, 2013 11:50 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 204 guests