FPCEF3 component is working in another window on Linux. [solved COMPLETELY] lazarus / 38-Networking and Web Programming ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-19 18:02 I am having a issue with fpCEF3. I am going crazy because there is no errors at all. What i do: 1- Create a new project from zero. 2- Copy resources and release to the root of the project. 3- Add a Chromium component to the main form. 4- Set default url to https://www.google.com.br in the component properties. What happen if a compile and run it on: 1- Windows: It opens only a window with chromium component loading google in the main form. 2- Linux - It opens 2 windows, the main form , and a new additional window, loading google fine but in a new detached window. And the strangest thing is that the LCLsimple example, works in the same window but it just show a blank screen, no matter what i do with the project. Maybe is something related to the lazarus version? Lazarus 1.6 FPCEF for CEF 2743 Debian 8 64 bits operating system, graphical environment: Mate ---------------------------------------------------------------------- skalogryz · 2016-12-19 18:27 do you've subprocess setup? btw, are you using Gtk2 or Qt widgetset? you're using Mate, so it must be Gtk2?! ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-19 18:50 Actually im running in gtk2... I just install lazarus on linux and do exactly what i say, nothing more. How do i configure subprocess? ---------------------------------------------------------------------- skalogryz · 2016-12-19 18:51 You need to have subprocess compiled (you should find the project in Examples) and just copy the executable to the same directory as LCLSimple executable. ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-19 19:58 Ok it solves the problem with lclsimplebrowser not showing nothing until i modify it, depending on the modification that i do for example removing the url bar and fixing it to google, the browser start separating the main window from the browser window.  In windows i dont have this issues! For example if i just remove a button on the form the browser component start to detach from the main form... This problem occurs if i create the browser from the zero too, even if i just copy the code from the lclsimple browser. ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-19 20:27 Now i found the secret but i am more confused now. When i delete or just hidde the componen lUrl (it just a stupid text element), from the example it reproduces the problem! (the browser start to appear in other window) Strange isn't? If i just delete it (it is just a static text component), and do a ctrl+z for example the problem is still there. But if i just set visible to false the component static text the problem occurs, but it is solved again if it to true. I just cant delete it, the bug start to occur, i tried different versions of lazarus without success. Debian 8 here. ---------------------------------------------------------------------- skalogryz · 2016-12-19 20:29 sorry, I don't have linux machine to confirm the issue at the moment. (in case you're expecting an answer from me right away) I'll try to see what's going on there a bit later today. ---------------------------------------------------------------------- skalogryz · 2016-12-19 23:59 ugh. I've tried to make it work, but it fails to run for me on my ubuntu 16.4 64biy. given up. sorry. was trying to run CEF 3.2785 (from cefbuilds.com)... maybe that's the issue. ... still couldn't make it to work. and Debug version of .so won't even load failing at LoadLibrary()! (too big?!) Anyways. Try to run TestApp from a Cefbuild. See if it behaves properly. (it ran just fine for me) ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-20 12:35 Yes i finally got it working fine on Debian 8, but only using the QT version of lazarus (GTK2 is not working good for me with FPCEF)! UPDATE: PLEASE SEE THE LAST MESSAGES, A PATCH FOR GTK 2 FROM THE DEVELOPER! http://forum.lazarus- ide.org/index.php/topic,35180.msg232406.html#msg232406 Installed on debian the lazarus qt from debian testing release - you will need to edit the sources.list (lazarus 1.6X) (And for some reason everything related to lazarus including some gtk libraries): Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #apt-get install lazarus-ide-qt4 lazarus-* Install everything related to lcl qt and others: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i #apt-get install lcl-qt4 lcl-* Remove the local configuration for Lazarus (CAUTION: this will remove all your frameworks) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $rm  -rf ~/.lazarus Start lazarus qt: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $/usr/lib/lazarus/default/lazarus-qt4 Install FPCEF 2743 on Lazarus qt(rebuild lazarus) and download the cef 2743 binaries for linux. Before compiling save your project to a folder without spaces ex: /home/youruser/myproject Do not compile and Exit lazarus qt. Copy the cef binary files to their places (and you will need to do this stupid workaround) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i cp -a Release/* /home/youruser/myproject/cp -a Resources/* /home/youruser/myproject/  cp -a Resources /home/youruser/myproject/cp -a Release/libcef.so /usr/lib Start lazarus-qt again but now using other command: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i $~/.lazarus/bin/lazarus Edit the project source (Project -> View project source), and modify your program code removing the additional condition here: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  {$IFDEF UNIX}{$IFSTUPIDCONDITIONCAUSINGTROUBLE}  cthreads,  {$ENDIF}{$ENDIF}  to Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  {$IFDEF UNIX}  cthreads,  {$ENDIF}  (only ifdef unix is required) Put the chromium component to your project and recompile, that is it! You got a FPCEF working on Linux. ---------------------------------------------------------------------- skalogryz · 2016-12-20 14:50 Did you try CEF TestApp to see how it works with Mate? ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-20 18:05 The QT version is working inside mate. I will try that now. The biggest trouble i am having now is with the printing, both in GTK or QT, the printer dialog simple does not open in Linux, and there is no errors... (i really need help with that!) This is all i get when try to open fpcef print dialog using gdb: Quote[New Thread 0x7fff833fa700 (LWP 32077)] [Thread 0x7fff833fa700 (LWP 32077) exited] ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-21 19:37 I solved the GTK version with this patch, suggested by the developer here: https://github.com/dliw/fpCEF3/issues/38 diff --git a/Component/cef3lcl.pas b/Component/cef3lcl.pas @@ -687,6 +687,7 @@ begin        fParentForm := GetParentForm(Self);        {$IFDEF LCLGTK2} +        gtk_widget_realize(PGtkWidget(fParentForm.Handle));          info.parent_window := gdk_window_xwindow(PGtkWidget(fParentForm.Handle)^.window);        {$ENDIF}        {$IFDEF LCLQT} ---------------------------------------------------------------------- skalogryz · 2016-12-21 22:01 Great! now you need to report the issue about the printer! ..oh wait! u did! ---------------------------------------------------------------------- Luciano Andress Martini · 2016-12-22 12:01 Thank you. I am not a programmer  , in fact i am just a server administrator (Linux), but i am acting like a programmer sometimes or this make me a programmer? I think not yet! ... Thank you very much for your help! God bless you all. Luciano A. Martini ---------------------------------------------------------------------- skalogryz · 2016-12-22 12:21 A programmer is not the one who writes the code, but the one who debugs. And that makes you a programmer