[kaffe] [AWT] Bug Report: Frame "size" problems

Dalibor Topic robilad@yahoo.com
Mon Mar 31 05:00:02 2003


--0-630509452-1049115697=:81105
Content-Type: text/plain; charset=us-ascii
Content-Id: 
Content-Disposition: inline

--- Daniel Tschernatsch <daniel.tschernatsch@gmx.de>
wrote:
> In my Application (a game, which hits
> gnu.savannah.org very soon) I need a 
> little bit more consistency of the java.awt.Frame's
> size. I added a Panel to 
> the Frame, that is in control of it's size using the
> getPrefferedSize method. 
> But running my program I ended up with a Frame
> showing my Panel in bigger 
> Dimension(s) than I expected. Calling
> Frame.setResizable(false) doesn't 
> really freeze the size of a Frame since a use can do
> a shade/unshade to have 
> some strange but harmful effect...
> 
> Is this going to be fixed in the next release of
> Kaffe? Hope that anybody 
> takes a look at my problem. I'm sorry, I had no
> chance to try out the CVS 
> version.
> Thank you.

Sorry for the late reply, I hope I can provide some
assistance to solve this problem. I've attached a
preliminary patch against the current CVS and an
updated version of your test program. It should get
the size mostly right, according to the test program.
Only in the end, X seems to dispatch a reparentNotify
event, whatever that's good for, which erases the
insets of the frame, leading to resizing of the panel.
I've got no idea about Xlib programming so it may take
a while until I can figure out what reparentNotify is
good for. Unfortunately, whoever wrote the awt code,
wasn't very keen on commenting its design and
intentions for programmers who haven't got a grasp of
Xlib. Beside that, there is some weirdness within the
event handler hierarchy: kaffe seems to treat the
window closing event as a component event, where sun's
jdk treats it like a window event.

I haven't looked at the shading unshading issue yet,
because I'm not sure what it means ... do you mean you
drag another window over the frame, or do you
iconify/deiconify it?

Could you report back if the patch fixes the problems
you have experienced?

cheers,
dalibor topic

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com
--0-630509452-1049115697=:81105
Content-Type: application/octet-stream; name=awt-insets-patch
Content-Transfer-Encoding: base64
Content-Description: awt-insets-patch
Content-Disposition: attachment; filename=awt-insets-patch

ZGlmZiAtdXIga2FmZmUvbGlicmFyaWVzL2phdmFsaWIvamF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jEuMTQufgo=

--0-630509452-1049115697=:81105
Content-Type: application/octet-stream; name="Debug.java"
Content-Transfer-Encoding: base64
Content-Description: Debug.java
Content-Disposition: attachment; filename="Debug.java"

aW1wb3J0IGphdmEuYXd0Lio7CmltcG9ydCBqYXZhLmF3dC5ldmVudC4qOwoK
cHVibGljIGNsYXNzIERlYnVnIGV4dGVuZHMgRnJhbWUgewoKCXByaXZhdGUg
c3RhdGljIFBhbmVsIHA7CgogICAgcHVibGljIERlYnVnKCkgewoJICAgIHAg
PSAKCQkgICAgbmV3IFBhbmVsKCkgewoJCQkgICAgcHVibGljIERpbWVuc2lv
biBnZXRQcmVmZXJyZWRTaXplKCkgewoJCQkJICAgIFRocm93YWJsZSB0ID0g
bmV3IFRocm93YWJsZSgpOwoJCQkJICAgIHQuZmlsbEluU3RhY2tUcmFjZSgp
OwoJCQkJICAgIHQucHJpbnRTdGFja1RyYWNlKFN5c3RlbS5vdXQpOwoJCQkJ
ICAgIAoJCQkJICAgIHJldHVybiBuZXcgRGltZW5zaW9uKDY0MCwgMzcwKTsK
CQkJICAgIH0KCgkJCSAgICBwdWJsaWMgdm9pZCByZXNoYXBlICggaW50IHhO
ZXcsIGludCB5TmV3LCBpbnQgd05ldywgaW50IGhOZXcgKSB7CgkJCQkgICAg
VGhyb3dhYmxlIHQgPSBuZXcgVGhyb3dhYmxlKCk7CgkJCQkgICAgdC5maWxs
SW5TdGFja1RyYWNlKCk7CgkJCQkgICAgdC5wcmludFN0YWNrVHJhY2UoU3lz
dGVtLm91dCk7CgoJCQkJICAgIFN5c3RlbS5vdXQucHJpbnRsbigibmV3OiAi
ICsgIHdOZXcgKyAieCIgKyBoTmV3KTsKCQkJCSAgICBzdXBlci5yZXNoYXBl
KHhOZXcsIHlOZXcsIHdOZXcsIGhOZXcpOwoJCQkgICAgfQoJCSAgICB9OwoJ
ICAgIFN5c3RlbS5vdXQucHJpbnRsbihwKTsKCSAgICBhZGQocCk7CgkgICAg
U3lzdGVtLm91dC5wcm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