From 328fe8b0cb8191641275a4a43c426cb6ce88305f Mon Sep 17 00:00:00 2001 From: Thomas Fitzsimmons Date: Wed, 6 Dec 2006 20:13:27 +0000 Subject: 2006-12-06 Thomas Fitzsimmons * 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. --- .../jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c | 2 +- .../gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c | 18 +++++++++--------- .../jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) (limited to 'native') 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); } -- cgit v1.2.1