[Lazarus] fpCEF3 questions

Torsten Bonde Christiansen tc at epidata.info
Thu Sep 14 15:30:38 CEST 2017


On 2017-09-14 15:05, dev.dliw--- via Lazarus wrote:
>> With main menu:
>>    - notice the lacking tabs, this is more prominent if not using a
>> pagecontrol, but
>>      any other wincontrol to host the browser.
> I see.
> The problem is, that the menu does not change the position of the controls on
> the form.
> E.g. if you out a button with Top=0 on an empty form and then add a menu, Top
> stays at 0. So the offset of TChromium is wrong.
>
> As a workaround you could change the position of the TChromium component (if
> on Linux).
> As I said, fpCEF on Linux embeds CEF into the XWindow of the main form, which
> is more or less a borderless window manually positioned over the LCL form.
I tried with applying the height of the TMenu, but the GTK 
implementation seems to have a generic
value witch not truely corresponds to active DE and the style/font used...

I guess I will have to live with it the way it is for now.

>
>
>> In my project i create an HTML output for a statistical analysis program
>> and the code itself is very simple - tables and paragraph, and only very
>> little CSS.
> It doesn't really matter what you show via TChromium, but how you use
> TChromium.
> And the tabbed browser is probably the most complex case and unfortunately
> rather broken on Linux right now.
>
> However, if you really only want to show very simple HTML, then
> 	https://github.com/BerndGabriel/HtmlViewer
> may possibly be the better choice for you.
The whole reason for using CEF was because the THhtmlViewer component is 
too slow! Especially in my case since I often work with
many and large tables (100 / 1000+ rows) which causes significal 
slowdows in that component.

>
>> In the OSR example the painting is tied to OpenGL IIRC, but can it be
>> tied to something else? and how?
> Actually not. CEF only provides an array of pixel values, it is up to you to
> do whatever you want.
> Older versions of the OSRDemo used BGRABitmap:
> https://github.com/dliw/fpCEF3/blob/5335a5ba437d469eb6f933e47ae0e0cd3d6e8968/Examples/OSRDemo/main.pas#L113

I will check that link out later and see if I can make the switch.

>
>
>> Another issue with all the versions of CEF i have tried so far is that I
>> get a SIGSEGV when closing any application that uses fpCEF. I have tried
>> many combinations when trying to shutdown, but it seems to boil down to
>> calling "CefCloseLibrary" that causes the SIGSEGV.
> See the last part of my answer in this issue:
> https://github.com/dliw/fpCEF3/issues/47#issuecomment-281333395
I have already made sure to sync both the fpCEF and the CEF-minimal i 
can download, but i still get the problem.

For now i can make the call in a try .. except block and catch the error 
when closing down. That way the problem is only
visible during debugging. :)



>
> In the meantime I have a version which implements the correct CEF shutdown
> process. It works fine if there is only a single TChromium instance, but has
> side effects when used in the tabbed browser. Focus get lost for all other
> instances and there is no way to get it back, browser content turns black,
> etc.
> -> headaches...
>
>
> So no good nows - sorry. It very much depends on CEF to improve the usage on
> Linux.
If my testing can help you in anyway just say so. I'm no hardcore GTK 
coder, but i have a little experience so
I will try to see if I can assist you whenever possible.


Kind regards
Torsten.


More information about the Lazarus mailing list