You're right!martin_fr wrote: Sat Feb 20, 2021 8:00 pmBut the current example in demos/Lazarus_Linux/TinyBrowser2 does not follow that example.salvadordf wrote: Thu Feb 18, 2021 5:53 pm Even when you don't use a "sandbox", Chromium will execute a function related to that feature that will cause problems when it detects more than one thread. That's why we have to call gtk_init after the CEF initialization for the main browser process only :
https://bitbucket.org/chromiumembedded/cef/src/8f5fdc1f9adb0aa81f9db4c3f0d74d08d554ccc5/tests/cefclient/cefclient_gtk.cc#lines-113
It uses the normal "Interfaces" unit.
CreateWidgetSet is called during initialization of that unit. And that is before the main body of the .lpr file gets executed. So before the CefApplication is created and run.

That was the first demo that worked in Linux and I didn't notice it contradicts the CEF code comments.
TinyBrowser2 is equivalent to the official cefsimple demo and it's the only one using the single thread mode without an external message pump. Perhaps calling cef_run_message_loop and the settings I mentioned before are the cause for this exception.
The Interfaces unit is not necessary in that demo so I just removed it in the last update.
Thanks!martin_fr wrote: Sun Feb 21, 2021 2:49 am You did place
function TChromiumWindow.GetChildWindowHandle : THandle;
in an IFDEF WINDOWS
But that gets the handle from the TChronium, and works on all OS.
It is also all-OS on LinkedParentWindow
In the implementation (for fpc) it needs LclType.THandle as result type.
Because sysutils redefines THandle.
Or move "SysUtils" from the implementation to the interface, but put it *first* in the uses list.
I just uploaded the fix for those issues and a few other fixes : focus on Linux, string conversions, etc.