diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2005-08-31 21:18:13 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2005-08-31 21:18:13 +0000 |
commit | 9678cc0245285f5dee64b891c15ce81c47662d97 (patch) | |
tree | 7063f7439309511e3a5d4b55ee246f3ed55816a8 /gnu/java/awt | |
parent | 72aac9545cb7d649a067594d257258700eb2edf9 (diff) | |
download | classpath-9678cc0245285f5dee64b891c15ce81c47662d97.tar.gz |
2005-08-31 Thomas Fitzsimmons <fitzsim@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java (setBounds): Only
add parent's x and y co-ordinates to translation if parent's
parent is not a window.
Diffstat (limited to 'gnu/java/awt')
-rw-r--r-- | gnu/java/awt/peer/gtk/GtkComponentPeer.java | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/gnu/java/awt/peer/gtk/GtkComponentPeer.java index 3e3e70da2..60e837127 100644 --- a/gnu/java/awt/peer/gtk/GtkComponentPeer.java +++ b/gnu/java/awt/peer/gtk/GtkComponentPeer.java @@ -424,6 +424,7 @@ public class GtkComponentPeer extends GtkGenericPeer int new_y = y; Component parent = awtComponent.getParent (); + Component next_parent; // Heavyweight components that are children of one or more // lightweight containers have to be handled specially. Because @@ -441,12 +442,22 @@ public class GtkComponentPeer extends GtkGenericPeer { lightweightChild = true; + next_parent = parent.getParent (); + i = ((Container) parent).getInsets (); - new_x += parent.getX () + i.left; - new_y += parent.getY () + i.top; + if (next_parent instanceof Window) + { + new_x += i.left; + new_y += i.top; + } + else + { + new_x += parent.getX () + i.left; + new_y += parent.getY () + i.top; + } - parent = parent.getParent (); + parent = next_parent; } // We only need to convert from Java to GTK coordinates if we're |