Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

More GlobalCEFApp initialization changes

Post Reply
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

More GlobalCEFApp initialization changes

Post by salvadordf »

Hi,

I've modified the GlobalCEFApp initialization and now GlobalCEFApp includes a custom BrowserProcessHandler to know when the global context is initialized.

According to the General Usage tutorial in the CEF3 web page, we should call TChromium.CreateBrowser after the global context is initialized or in the TForm.OnCreate event.

All demos use the TForm.OnShow to call CreateBrowser which is triggered after TForm.OnCreate, but in some occasions this is not enough and you may get a white screen with a crAppStart cursor (Hour glass and standard pointer combination).

Now GlobalCEFApp has all BrowserProcessHandler's events, including OnContextInitialized. If you have detected this problem in your app I suggest you use this event to know when you can start creating browsers.

Remember that the GlobalCEFApp.OnContextInitialized is called in a different thread and it should NOT be used to create components, only to signal your app that you can start creating browsers.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: More GlobalCEFApp initialization changes

Post by salvadordf »

I forgot to tell that GlobalCEFApp has a new boolean property called GlobalContextInitialized that is set to True when the global context is initialized.
Post Reply