Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting SWT embedding to work under Linux #18

Open
fiveop opened this issue Oct 12, 2017 · 4 comments
Open

Getting SWT embedding to work under Linux #18

fiveop opened this issue Oct 12, 2017 · 4 comments

Comments

@fiveop
Copy link

fiveop commented Oct 12, 2017

I managed to switch from AWT to SWT embedding on Windows. This however broke the Linux Version. With the arguments for XSystemChildFactory#createSystemChild(...) in LocalOfficeConnection#getOfficeFrame(Composite) set correctly - container.embeddedHandle instead of container.handle and SystemDependent.SYSTEM_XWINDOW instead of SystemDependent.SYSTEM_WIN32 - I can open a document. Loading another document after closing the previous yields an exception however (https://github.com/LibreOffice/core/blob/539c75b910f518a1fe51e9a21f6368a91c69ed88/framework/source/fwi/threadhelp/transactionmanager.cxx#L183).

Did anyone manage to embed LO successfully using SWT under Linux?

@gitxpy
Copy link

gitxpy commented Jan 26, 2018

for reference, the attached code fixes and extends this original example FrameWithSWT.java

FrameWithSWT_fix.zip

it works ok with gtk2 (rh6)
ex_gtk2

but have same issue as in #6 with gtk3 (rh7) :(
ex_gtk3

it seems there's no more proper support for container.embeddedHandle ?

@rhizoome
Copy link

rhizoome commented Sep 17, 2018

We have reproduced this issue @adfinis-sygroup, while I haven't solved the issue with gtk3, I was able to provide a workaround. Run the noa-app with gtk2 by setting the environment variable: SAL_USE_VCLPLUGIN=gtk. We have decided that this is a feasible medium-term workaround.

With gtk3 I noticed that LibreOffice isn't embedded at all. It creates a small window, the window-manager recognizes it as a full window.

not embedded

My wild guess: the embedded window is 'XReparentWindow()ed' out of the noa-app after noa has embedded the window. My next step would be.

  • Use one of X11 tracing programs: Xmon, Xtrace, xtruss and try to see what is going on

  • Find out if noa uses XEmbed, XReparentWindow or a method I don't know yet to embed LibreOffice

  • Write a C Xlib program that tries to embed LibreOffice with gtk2 and gtk3 and compare the results

I haven't verified any of the next steps and it's out of the scope of my task.

@lfcnassif
Copy link

SAL_USE_VCLPLUGIN=gen worked, but with focus problems. SAL_USE_VCLPLUGIN=gtk workerd fine, but I had to install libreoffice-gtk2. Hope this helps.

@opcoach
Copy link

opcoach commented Aug 28, 2019

Hi,
If you have a bug regarding SWT and its implementation with GTK you should consider to open a bug directly on bugs.eclipse.org in the platform product and the swt component. There are already a lot of bugs declared as returned by this request :

I opened one (550517) this morning about the focus.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants