Status of LO embedding inside other processes windows?

Robert Marcano robert at marcanoonline.com
Wed Feb 21 15:55:31 UTC 2018


Greetings. I have been playing with the developers guide example [1] for 
embedding LO inside a Java window (Swing toolkit). The example works on 
a Windows host, but on Linux I found the following problems (in the 
order I found)

1- When the host Java application is running on a Wayland session (Java 
Swing is still an X11 program), there is a crash. IIRC LO still is a X11 
based application (or at least the Fedora compiled version is using the 
X11 GTK back-end)

2- Switched to an X11 desktop session, there was no crash this time, but 
the document was not shown embedded on the Java window, it was a 
floating window with no window controls, unresponsive to the user.

3- Run the same application with the environment variable 
SAL_USE_VCLPLUGIN=gtk in order to force the LO GTK2 back-end. The 
document is embedded on the Java window as expected, but keyboard input 
is not possible on the document or the controls, mouse actions works, 
for example, I can change fonts using the mouse, but can't write 
anything on the font combobox nor the document. New LO dialogs opened 
from that document, keyboard input works.

4- Trying with SAL_USE_VCLPLUGIN=gen and keyboard input now works, but 
with the outdated look of that LO VCL backend :(

So now the possible reasons that came to my head for each case:

1- Some confusion between Java being X11 and LO trying to do some 
Wayland thing?

2- Java has a GTK Look and Feel/theme that loads GTK2 (the example 
application does not load that theme) , I am under the impression that 
if LO is loading GTK3, they are on different processes, so should not be 
any conflict here.

3- Now both processes should be using GTK2, but the problems with 
keyboard input is a blocker

4- Everything running without conflicting libraries/protocols (Wayland 
vs X11 or GTK3 vs GTK2) and work, but the look and feel!!!!!!

Now, when running the example with a no inline option, everything works 
fine, even when GTK2 and GTK3 are mixed. Wish to have an option to 
create the new document top level window as a child of the Java window, 
it is a pain for user that the document can go to the back of the 
"caller" window. Any hints if this is possible between two processes 
like Java and LO?

Any other developer here embedding LO in another applications on Linux 
that can give me any pointers? Before starting to look on enhancing LO 
embedding on Linux, is there any technical reasons things are 
working/non working this way?

Thanks in advace.

[1] 
https://api.libreoffice.org/examples/DevelopersGuide/OfficeDev/DesktopEnvironment/


More information about the LibreOffice mailing list