Two browsers in the same window
Posted: Fri Jan 13, 2023 8:04 pm
I am porting my application from CEF3 to DCEF4 and things are going fairly well except for one program. This program has 2 browsers in the same form. They are contained in separate pages of a page control and the user can switch between by clicking the tabs of the page control. I am going to admit right up front that this program is a hacked up kludge but it works using CEF3.
The first browser is created using a TChromium control on the main form with a TCEFWindowParent in the first page of the page control. No problem. The second browser is wholly contained in another TForm that is attached to the second page of the page control using TForm.CreateParented. This second form has a bunch of logic in it to interact with OpenStreetMaps and is used as a standalone form in other parts of the application. The second form has its own TChromium and TCEFWindowParent controls. You don't have to tell me, I know it's a dog's breakfast.
Using this setup the browser pages work intermittently. Some times the first one works, sometimes the second. It seems to depend on which events fire first. My question is how can I make two separate browser windows work reliably in a single form? Can I attach both TCEFWindowParent controls to the same TChromium? Would that fix my problem?
Thanks in advance
Steve
The first browser is created using a TChromium control on the main form with a TCEFWindowParent in the first page of the page control. No problem. The second browser is wholly contained in another TForm that is attached to the second page of the page control using TForm.CreateParented. This second form has a bunch of logic in it to interact with OpenStreetMaps and is used as a standalone form in other parts of the application. The second form has its own TChromium and TCEFWindowParent controls. You don't have to tell me, I know it's a dog's breakfast.
Using this setup the browser pages work intermittently. Some times the first one works, sometimes the second. It seems to depend on which events fire first. My question is how can I make two separate browser windows work reliably in a single form? Can I attach both TCEFWindowParent controls to the same TChromium? Would that fix my problem?
Thanks in advance
Steve