diff options
author | Thomas Fitzsimmons <fitzsim@redhat.com> | 2006-12-06 19:46:17 +0000 |
---|---|---|
committer | Thomas Fitzsimmons <fitzsim@redhat.com> | 2006-12-06 19:46:17 +0000 |
commit | 5ad612425520b68d0df0f3d45ad1e533ce6e0676 (patch) | |
tree | 9558173ab7d82bb034d68f52a8c9629c86c2a974 /native/jni | |
parent | f52cd482a21b1fef468473782764cf5e96ccd20e (diff) | |
download | classpath-5ad612425520b68d0df0f3d45ad1e533ce6e0676.tar.gz |
2006-12-06 Thomas Fitzsimmons <fitzsim@redhat.com>
* java/awt/ScrollPane.java (addNotify): Add a parent panel for any
lightweight component, not just for non-Panel components.
(addImpl): Do not call doLayout.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
(setNativeBounds): Ensure widget parent is a GtkFixed before
calling gtk_fixed_move.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
(setNativeBounds): Likewise.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
(setNativeBounds): Likewise.
Diffstat (limited to 'native/jni')
3 files changed, 11 insertions, 11 deletions
diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c index 6a9066cbe..1099287e2 100644 --- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c +++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c @@ -353,7 +353,7 @@ Java_gnu_java_awt_peer_gtk_GtkButtonPeer_setNativeBounds /* ...and the label's size request. */ gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (child)), width, height); - if (widget->parent != NULL) + if (widget->parent != NULL && GTK_IS_FIXED (widget->parent)) gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y); } diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c index 39524eea0..d2025bb70 100644 --- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c +++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c @@ -659,16 +659,16 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeBounds width = width < 0 ? 0 : width; height = height < 0 ? 0 : height; - if (GTK_IS_VIEWPORT (widget->parent)) - gtk_widget_set_size_request (widget, width, height); - else + if (!(width == 0 && height == 0)) { - if (!(width == 0 && height == 0)) - { - gtk_widget_set_size_request (widget, width, height); - if (widget->parent != NULL) - gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y); - } + gtk_widget_set_size_request (widget, width, height); + /* The GTK_IS_FIXED check here prevents gtk_fixed_move being + called when our parent is a GtkScrolledWindow. In that + case though, moving the child widget is invalid since a + ScrollPane only has one child and that child is always + located at (0, 0) in viewport coordinates. */ + if (widget->parent != NULL && GTK_IS_FIXED (widget->parent)) + gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y); } gdk_threads_leave (); diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c index 77021ceec..13473a9a8 100644 --- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c +++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c @@ -213,7 +213,7 @@ Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setNativeBounds gtk_widget_set_size_request (gtk_bin_get_child (GTK_BIN (widget)), width, height); - if (widget->parent != NULL) + if (widget->parent != NULL && GTK_IS_FIXED (widget->parent)) gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y); } |