[kaffe] problem using QtAWT with 1.1.5 (Gnu Linux/i686)
Alexander Boettcher
ab764283 at os.inf.tu-dresden.de
Fri Apr 29 03:50:42 PDT 2005
Hi,
I have some patches for the QT backend.
gian paolo ciceri schrieb:
> [gpciceri at sandra example]$ /usr/local/kaffe-1.1.5-JIT-qt/bin/kaffe
> -Xkaffe-qt-awt AnimatorApplication
> java.lang.ArrayIndexOutOfBoundsException
> ~ at java.awt.ComponentEvt.getEvent (ComponentEvt.java:98)
> ~ at java.awt.Toolkit.evtGetNextEvent (Toolkit.java)
> ~ at java.awt.EventQueue.getNextEvent (EventQueue.java:174)
> ~ at java.awt.EventDispatchThread.run (EventDispatchThread.java:34)
> ~ at java.lang.VMThread.run (VMThread.java:123)
This happens also for me. The reasons seems to be, that the method
"EventDispatcher::eventFilter" in "kaffe/libraries/clib/awt/qt/evt.cc"
receive events for objects (var o) from QT, that are not registered in
Kaffe's backend. (I use QT 3.3.1 with Linux and a port of QT 3.3.4 with
DROPS/L4). The objects seems not to be from Kaffe, seems to be from the
QT internal. Therefore, the function "getSourceIdx" returns
0xffffffff(unsigned) or -1 (signed) for these objects, therefore later
"java.awt.ComponentEvt.getEvent" fails. The patch evt.diff prevents
processing these events. I don't know, whether it is ok, or it is a bug
of QT ? However, no outofbounds exception are thrown and the QT GUI
backend works.
> after a while ...
>
> QtAWT - Warning: QPainter: Internal error; no available GC
Before this message, I get :
QtAWT - Warning: QWidget (unnamed): deleted while being painted
QtAWT - Warning: QPaintDevice: Cannot destroy paint device that is being
painted
and then
QtAWT - Warning: QPainter: Internal error; no available GC
QtAWT - Warning: QPainter: Internal error; no available GC
...
If a QWidget is closed (Window, etc.), it seems that all QPainter
objects have to be closed. If not, QT complains and later fails. The
patches NativeGraphics.diff and gra.diff close the QPainter objects,
created in the function "Java_java_awt_Toolkit_graInitGraphics" in
"kaffe/libraries/clib/awt/qt/gra.cc". With these patches, the QT backend
of Kaffe works and QT does not complain :-).
Another patch is necessary for the color defines in
"kaffe/libraries/clib/awt/qt/toolkit.h". If they are used with
"Java_java_awt_Toolkit_graSetXORMode" in
"kaffe/libraries/clib/awt/qt/gra.cc", they will produce color values >
255 and QT complains :
QtAWT - Warning: QColor::setRgb: RGB parameter(s) out of range
toolkit.diff solves it.
Regards,
Alexander Boettcher.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: evt.diff
Url: http://kaffe.org/pipermail/kaffe/attachments/20050429/a49575c4/attachment-0008.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NativeGraphics.diff
Url: http://kaffe.org/pipermail/kaffe/attachments/20050429/a49575c4/attachment-0009.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gra.diff
Url: http://kaffe.org/pipermail/kaffe/attachments/20050429/a49575c4/attachment-0010.txt
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: toolkit.diff
Url: http://kaffe.org/pipermail/kaffe/attachments/20050429/a49575c4/attachment-0011.txt
More information about the kaffe
mailing list