diff options
author | Lillian Angel <langel@redhat.com> | 2006-05-25 14:32:00 +0000 |
---|---|---|
committer | Lillian Angel <langel@redhat.com> | 2006-05-25 14:32:00 +0000 |
commit | b328da9bdcbab6bbab0aa50546e19a326343b507 (patch) | |
tree | 6bfba16a5f8bf9fcf537c049138986dedcb5a131 | |
parent | 609d8f41998f6a2c73b777058b449e56dbf7f54a (diff) | |
download | classpath-b328da9bdcbab6bbab0aa50546e19a326343b507.tar.gz |
2006-05-25 Lillian Angel <langel@redhat.com>
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
(Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursorUnlocked):
Added check to prevent assertion error. If widget->window is null, then
use the parent widget's window to set the cursor on.
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c | 11 |
2 files changed, 15 insertions, 3 deletions
@@ -1,3 +1,10 @@ +2006-05-25 Lillian Angel <langel@redhat.com> + + * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c + (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursorUnlocked): + Added check to prevent assertion error. If widget->window is null, then + use the parent widget's window to set the cursor on. + 2006-05-25 Audrius Meskauskas <AudriusA@Bioinformatics.org> * javax/swing/plaf/basic/BasicTreeUI.java (TreeCancelEditingAction): 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 b0d4ab9b0..acf646591 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 @@ -204,6 +204,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursorUnlocked { void *ptr; GtkWidget *widget; + GdkWindow *win; GdkCursorType gdk_cursor_type; GdkCursor *gdk_cursor; @@ -255,16 +256,20 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursorUnlocked } widget = get_widget(GTK_WIDGET(ptr)); - + + win = widget->window; + if ((widget->window) == NULL) + win = GTK_WIDGET(ptr)->window; + if (image == NULL) gdk_cursor = gdk_cursor_new (gdk_cursor_type); else gdk_cursor - = gdk_cursor_new_from_pixbuf (gdk_drawable_get_display (widget->window), + = gdk_cursor_new_from_pixbuf (gdk_drawable_get_display (win), cp_gtk_image_get_pixbuf (env, image), x, y); - gdk_window_set_cursor (widget->window, gdk_cursor); + gdk_window_set_cursor (win, gdk_cursor); gdk_cursor_unref (gdk_cursor); /* Make sure the cursor is replaced on screen. */ |