Patch for kjas (was: Java applets and ConfigureRequest)

Lubos Lunak l.lunak at suse.cz
Mon Dec 8 17:00:10 GMT 2003


On Saturday 06 of December 2003 20:52, Koos Vriezen wrote:
> On Sat, 6 Dec 2003, Koos Vriezen wrote:
>
> Why do I always come with fresh ideas after discribing a problem and
> sending it to kfm-devel?
> Anyway, attached a patch that fixes the gray rectangle problem, simply by
> calling 'frame.setUndecorated(true)'. Also changing JFrame to Frame,
> saving three parents layering (actually the JPanel can be skipped to, but
> leave it for now). I finally can use teletext on http://www.n-tv.de/ again
> w/o random buttons not coming up)
> Please review.
>
> (of course, what has changed in kwin/qxembed that java windows needs this
> now?)

 I'm not sure if I can count as somebody capable of reviewing your patch, as I 
know nothing about all this Java stuff, but I think I can explain the 
background.

 If I understood it correctly, in Java one specifies window sizes _including_ 
border sizes (i.e. the decorations added by the WM), which is serious 
braindamage from the X11 point of view, as it is difficult to reliably find 
out, you don't know it before showing the window, and so on. Java 
implementations probably use some weird tricks to find it out somehow, and in 
the (for them unexpected) case the window is reparented not inside a WM but 
inside an app they get it wrong. Moreover, I remember fixing some strange bug 
last week where Java detected KDE and used really weird and broken tricks.

 If you turn off borders in Java, that'll make it clear that all the borders 
sizes are 0, and Java will get it right. So, without knowing what your patch 
really does, I'd say your patch is right.

 You can also see 
http://mail.gnome.org/archives/wm-spec-list/2003-December/msg00005.html and 
the links listed there - we're currently discussing adding some WM hacks for 
it - apparently Wine needs it too.
 
>
> > Hi,
> >
> > Trying to find the cause of applets being wrongly embedded, I found that
> > the coordinates of the JFrame are totally wrong. To see this, do
> > - add '-Dkjas.debug=1' to 'Additional Java Arguments' setting
> > - start from the console eg
> >   konqueror 'http://developer.netscape.com/docs/examples/java/hitman.html
> >   press a few times F5 until a gray rectangle appears
> > - get the dimension via javascript, eg
> >   dcop konqueror-21639 html-widget1 evalJS '
> >   var
> > a1=document.applets[1].getParent().getParent().getParent().getParent().ge
> >tParent().getBounds()' (applets[1] means the second applet here)
> > - now either look at the console output or get it from 'a1' like
> >   a1.x/y/width/height eg.
> >    dcop konqueror-21639 html-widget1 evalJS 'a1.height'
> >

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/




More information about the kfm-devel mailing list