Page 1 of 1
Update to CEF 3.3497.1829.g004ef91
Posted: Sun Sep 16, 2018 9:18 am
by salvadordf
Hi,
CEF4Delphi is now updated to use CEF 3.3497.1829.g004ef91. It uses the same Chromium version as the previous update.
This CEF3 version includes these fixes :
I also added a new component to test a focus issue. It's called
TCEFLinkedWindowParent.
TCEFLinkedWindowParent is almost the same as TCEFWindowParent but it has a "
Chromium" property where you can set the TChromium component used in your app to create a web browser.
TCEFLinkedWindowParent uses the Chromium value to set the focus like the official CEF3 application does.
You can use TCEFLinkedWindowParent or TCEFWindowParent in your apps but if you're having some kind of focus issue then try TCEFLinkedWindowParent.
The CEF3 binaries are these :
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Sun Sep 16, 2018 7:36 pm
by thefunkyjoint
Hello,
I was getting the same issue with this version : when i run the SimpleBrowser_D7 project, the app crashes. The log file shows the same content :
[0916/155930.742:ERROR:gpu_process_transport_factory.cc(1017)] Lost UI shared context.
[0916/155930.748:VERBOSE1:webrtc_internals.cc(121)] Could not get the download directory.
But now i could find out what is causing the problem : it was related to the Windows theme i was using (High Contrast). Once i returned to the Default theme, the crashes solved !
This explains why i was getting the crashes on the Windows 2012 machine (which was on High contrast theme) , but not on my Windows 7 / 10 machines (which use the Default theme).
I recorded a video showing the issue :
https://youtu.be/dXUQs_lEPYM
Discovering the cause is very good news however i (and probably anyone) can't use the High contrast theme anymore... I love it because it used inverted colors (black background instead of white). This problem never happened until the previous release. Maybe with this info you can simulate the problem and hopefully find out a solution / workaround to get me my beloved theme back
Thank you !
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Sun Sep 16, 2018 8:53 pm
by salvadordf
Good catch!!!
Even the official CEF3 application crashes with high contrast themes on windows 7.
I'll do some more tests and report this issue in the CEF3 project.
Thank you very much!!!!

Re: Update to CEF 3.3497.1829.g004ef91
Posted: Tue Dec 11, 2018 10:36 am
by petko
salvadordf wrote: Sun Sep 16, 2018 9:18 amI also added a new component to test a focus issue. It's called
TCEFLinkedWindowParent.
TCEFLinkedWindowParent is almost the same as TCEFWindowParent but it has a "
Chromium" property where you can set the TChromium component used in your app to create a web browser.
TCEFLinkedWindowParent uses the Chromium value to set the focus like the official CEF3 application does.
You can use TCEFLinkedWindowParent or TCEFWindowParent in your apps but if you're having some kind of focus issue then try TCEFLinkedWindowParent.
Is there an equivalent of TCEFLinkedWindowParent for TChromiumWindow? In other words can TChromiumWindow automatically set the focus like TCEFLinkedWindowParent?
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Tue Dec 11, 2018 11:10 am
by salvadordf
The main difference between TCEFWindowParent and TCEFLinkedWindowParent is in the WndProc procedure.
TCEFWindowParent handles WM_SETFOCUS with this code :
Code: Select all
WM_SETFOCUS:
begin
TempHandle := ChildWindowHandle;
if (TempHandle <> 0) then PostMessage(TempHandle, WM_SETFOCUS, aMessage.WParam, 0);
inherited WndProc(aMessage);
end;
TCEFLinkedWindowParent handles WM_SETFOCUS with this code :
Code: Select all
WM_SETFOCUS:
begin
if (FChromium <> nil) then
FChromium.SetFocus(True)
else
begin
TempHandle := ChildWindowHandle;
if (TempHandle <> 0) then PostMessage(TempHandle, WM_SETFOCUS, aMessage.WParam, 0);
end;
inherited WndProc(aMessage);
end;
TChromiumWindow has exactly the same code in WndProc than TCEFLinkedWindowParent.
They should behave identically when they receive a WM_SETFOCUS message.
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Tue Dec 11, 2018 6:05 pm
by petko
For some reason it is not working as expected for me. I have to manually set ActiveControl to the Chromium Window component (or use PostMessage(chromiumWindow->Handle, WM_SETFOCUS, 0, 0);) when it fires the GotFocus event. If I do not do that, then the ActiveControl stays the previously focused and not the Chromium..
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Tue Dec 11, 2018 6:08 pm
by salvadordf
What is the "TabStop" value for the TChromiumWindow?
If it's false, set it to true.
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Sun Dec 16, 2018 1:23 am
by petko
Yes, it was set to false, but unfortunately, setting it to true didn't fix the problem.
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Tue Dec 18, 2018 1:56 pm
by salvadordf
I'll add a new property to TChromiumWindow to use a simple message to set the focus.
Re: Update to CEF 3.3497.1829.g004ef91
Posted: Tue Dec 18, 2018 4:11 pm
by salvadordf
Please, download CEF4Delphi again.
Set the TChromiumWindows.UseSetFocus to FALSE to use a Windows message to set the focus.