Issue 97007 - LocalOfficeWindow can't gain focus or any keyboard input if running them in JDK6.0
Summary: LocalOfficeWindow can't gain focus or any keyboard input if running them in J...
Status: ACCEPTED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: Unknown Linux, all
: P2 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-08 09:46 UTC by zxkane
Modified: 2013-02-24 21:08 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description zxkane 2008-12-08 09:46:20 UTC
Run the test case in OOBeanTest with JDK5.0, the local office window can gain
the focus and input words. However, the integrated window can't gain the focus
and no response for any keyboard event if running it with JDK6.
Comment 1 jsc 2008-12-09 09:28:11 UTC
jsc -> tkr: bean issue
Comment 2 tkr 2009-03-04 12:31:46 UTC
accepted
Comment 3 tkr 2009-06-19 13:48:25 UTC
.
Comment 4 benzman81 2010-05-06 17:46:03 UTC
Is there somthin going on with this bug.
Our great app NOA4e (http://ubion.ion.ag/loesungen/003officeintegrationeditor)
to integrate OpenOffice.org into eclipse does not work anymore on Linux.
First, the issue was just when using gnome. But with latest kubuntu 10.04 the
issue also occurs in KDE. 
Our app uses the SWT_AWT bridge from SWT to integrate OOO. This way it doesn't
even work in JDK 5.0, just stopped 
working (maybe because of some changes in Linux).
I also read the following article http://wiki.services.openoffice.org/wiki/OOoBean

I also tried setting "sun.awt.xembedserver" to "true". This makes keyboard
interactions possible with AWT 

As I thought the problem is SWT I started testing around with with a simple AWT
app and even with the OOOBeanViewer applet.

I figured out the following:

Using JDK 5.0 and "sun.awt.xembedserver" is not set:
AWT applications and the OOOBeanViewer work and show the office window in
correct size

Using JDK 5.0 and "sun.awt.xembedserver" is set to "true":
AWT applications and the OOOBeanViewer do not work as it does not show the
office window.
  
Using JDK 6.0 and "sun.awt.xembedserver" is not set:
AWT applications and the OOOBeanViewer do not work. There is no keyboard
interaction possible, not even navigating in the menu, but shows office window
in correct size.

Using JDK 6.0 and "sun.awt.xembedserver" is set to "true": 
AWT applications and the OOOBeanViewer do not work. Keybord interaction is
possible, but the office window get always resized to a 200px by 200px window,
even trying to re-layout and setting size manually on every component I could find.


For a simple SWT viewer found here
http://www.eclipsezone.com/eclipse/forums/t48966.html I figured out the following:

Using JDK 5.0 and "sun.awt.xembedserver" is not set:
SWT application does not work. There is no keyboard interaction possible, not
even navigating in the menu, but shows office window in correct size.

Using JDK 5.0 and "sun.awt.xembedserver" is set to "true":
SWT application do not work as it does not show the office window, just a gray area.
  
Using JDK 6.0 and "sun.awt.xembedserver" is not set:
SWT application o not work. There is no keyboard interaction possible, not even
navigating in the menu, but shows office window in correct size.

Using JDK 6.0 and "sun.awt.xembedserver" is set to "true": 
SWT application do not work. Keybord interaction is possible, but the office
window get always resized to a 200px by 200px window, even trying to re-layout
and setting size  manually on every component I could find.


I even tried with the environment variables SAL_USE_VCLPLUGIN and USE_VCLPLUGIN
with all possible values ("gtk","kde","gen") for all above cases. This does not
seem to change anything.

This means, that a lot of integrations do not work with linux anymore, which
means that this is a very very high important bug (at least for us and our
community and customers).
  
Could someone please comment on what is the current state of the bug and when
this gets fixed, if ever, please?
  
Regards,

Markus Krüger
Comment 5 benzman81 2010-05-06 17:48:26 UTC
A workaround for AWT and SWT would help, too, for now...
Comment 6 zxkane 2010-05-07 03:41:57 UTC
There is another way to embed OOo into swt widget.
SWT is a wrapper of gtk, so you can create a swt composite as gtk socket, and
create OOo window as gtk client.

see XEmbed protocol for more detail
Comment 7 benzman81 2010-05-07 09:07:37 UTC
My understanding was, that the SWT_AWT bridge use XEmbed.
Also, I could not find an example on how to do it "manually" with the XEmbed
protocol.

What about the issue with AWT/OOOBeanViewer and JDK 1.6?

I need both, SWT and AWT, to be running under linux to satisfy our community and
customers.
Comment 8 benzman81 2010-05-07 09:09:04 UTC
And we need to support java 1.5 and 1.6 :-(
Comment 9 tkr 2010-05-07 09:45:41 UTC
Due lack of time I'm currently not able to fix this issue. But you can take a
look on your own (OOO Repos. Module bean). I would appreciate any patch to fix
this issue. 
Comment 10 benzman81 2010-05-07 09:50:04 UTC
What classes are responsible for displaying the window? I looked into
LocalOfficeWindow but could not find anything that might be responsible for
displaying the window 200px by 200px when using "sun.awt.xembedserver" is set to
"true" and jdk1.6.
Comment 11 benzman81 2010-06-01 08:27:37 UTC
hi tkr,

I know I can not make it faste to fix this, but is this actually in progress?
The status states "STARTED", but I don't see anything happen.
I don't want to bother you, but this is a bug which make our app only work with
windows, for know.

Regards,
Markus
Comment 12 jstaerk 2010-06-22 14:23:57 UTC
I'm using benzmans library (Nice Office Access) for my application and I have
the same issue...
Comment 13 jstaerk 2010-06-22 18:41:07 UTC
if anybody accidentally fixes this in the next weeks please claim bounty #2
(http://www.usegroup.de/?p=bounty-2-en), it may be related and it will not be
granted if it is not claimed.
Comment 14 benzman81 2010-07-20 13:45:03 UTC
I just tested again with a fresh installed kubuntu. It works with 1.5 and 1.6.
So the issue seems only to be related to gnome.
Comment 15 xnopso 2011-02-07 13:51:57 UTC
Can anyone else confirm that it works on kde again?
Comment 16 jstaerk 2011-02-07 17:43:17 UTC
I never experienced any issues in KDE, for me this always seemed to be a bug in
combination with gnome(2, never tested with 3, I think it worked in 1)
Comment 17 viktara 2011-03-23 12:23:26 UTC
Same problem here trying to embed openoffice in SWT on Linux.

How can we get some more focus on this bug?

tkr - can you suggest any steps that can help to debug this?
Comment 18 jstaerk 2011-05-14 09:02:52 UTC
I had also tried SAL_USE_VCLPLUGIN and USE_VCLPLUGIN some months ago but the link 

http://wiki.services.openoffice.org/wiki/OOoBean#nofocus 

provided some more insight, if not a workaround.

(Benzman: I actually got it from the NOA forum, more precisely from the libreoffice mailing list posts that 
NOA forum user bt10000 mentioned on http://ubion.ion.ag/mainForumFolder/noa_forum/0247/)

I started my software with -Dsun.awt.xembedserver=true and, although the caret still seemed to be absent, text 
input worked in Ubuntu 10.10.
Comment 19 xnopso 2011-05-15 16:09:19 UTC
(In reply to comment #18)

> I started my software with -Dsun.awt.xembedserver=true and, although the caret
> still seemed to be absent, text 
> input worked in Ubuntu 10.10.

Which version of java were you using?
Comment 20 jstaerk 2011-05-15 16:27:28 UTC
Hi
> 
> > I started my software with -Dsun.awt.xembedserver=true and, although the caret
> > still seemed to be absent, text 
> > input worked in Ubuntu 10.10.
> 
> Which version of java were you using?

Sun Java, must have been 1.6.
Comment 21 viktara 2011-05-16 08:54:54 UTC
> 
> I started my software with -Dsun.awt.xembedserver=true and, although the caret
> still seemed to be absent, text 
> input worked in Ubuntu 10.10.

I did try this and confirmed it did not work. I suspect it works on Ubuntu 10.10 because this issue seems limited to Linux with Gome 2.x.

I have tested this issue with Windows and Linux + KDE and it does not occur on either of those platforms.
Comment 22 jstaerk 2011-05-16 17:43:39 UTC
Hi

> I did try this and confirmed it did not work. I suspect it works on Ubuntu
> 10.10 because this issue seems limited to Linux with Gome 2.x.

I thought 10.10 was Gnome 2.32?

> I have tested this issue with Windows and Linux + KDE and it does not occur on
> either of those platforms.

It works on Windows but did you try the Fedora 14 KDE spin? It really astonished me, it was the only KDE based distro which did not seem to work.

kind regards
Jochen
Comment 23 viktara 2011-05-18 09:20:22 UTC
(In reply to comment #22)

> I thought 10.10 was Gnome 2.32?
My mistake! I was thinking of 11.04.

That's very interesting though - will download a copy and test it too.

> 
> It works on Windows but did you try the Fedora 14 KDE spin? It really
> astonished me, it was the only KDE based distro which did not seem to work.

No - I didn't try the Fedora spin. I got some pointers on the Libre Office mailing list about how to debug the underlying issue - so am planning to do that when I get some time.
Comment 24 jstaerk 2012-09-10 08:21:37 UTC
Please note that it now works on Fedora 17 and on Ubuntu (both unity and gnome2). The caret is still missing but the text input is passed to the officebean, at least with LibreOffice 3.6.1.