It took me a while to piece through what you meant but I finally got it!
If you're a total CEF-noob like me, here's some additional info:
Sub-processes refer to processes other than the browser process. If you extend CefApp and override OnBeforeCommandLineProcessing, the process_type is helpful. No value means the browser process.
My problem was CefExecuteProcess was opening my main application because it used the program part of the command-line by default for launching sub-processes. This caused failures when it tried to launch the rendering process, resulting in a white screen (no rendering). As magreenblatt described, the work-around for this is to specify a different executable to use when launching those subprocesses. The links in the connected thread are no longer valid, but if you do some sleuthing you can find
cefclient_helper_mac.cc. Here's code to create this helper executable:
- Code: Select all
#include "include/cef_app.h"
int main(int argc, char* argv[]) {
CefMainArgs main_args(argc, argv);
// Execute the secondary process.
return CefExecuteProcess(main_args, NULL);
}
Once you've created the helper executable, set CefSettings::browser_subprocess_path to point to your helper executable before calling CefInitialize(...).
Next step is offscreen rendering, but for tonight... success.