[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] fix GTK JAWT assertion failures
From: |
Thomas Fitzsimmons |
Subject: |
[cp-patches] fix GTK JAWT assertion failures |
Date: |
Wed, 31 Aug 2005 17:31:35 -0400 |
Hi,
I committed this fix for
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20782
We now simply return NULL if a JAWT call is made before a widget is
realized.
Tom
2005-08-31 Thomas Fitzsimmons <address@hidden>
PR awt/20782
* native/jni/gtk-peer/gtk_jawt.c
(classpath_jawt_get_default_display): Check if widget is realized
and return NULL if it is not.
(classpath_jawt_get_visualID): Likewise.
(classpath_jawt_get_drawable): Likewise.
Index: native/jni/gtk-peer/gtk_jawt.c
===================================================================
RCS file: /cvsroot/classpath/classpath/native/jni/gtk-peer/gtk_jawt.c,v
retrieving revision 1.2
diff -u -r1.2 gtk_jawt.c
--- native/jni/gtk-peer/gtk_jawt.c 20 Aug 2005 22:46:54 -0000 1.2
+++ native/jni/gtk-peer/gtk_jawt.c 31 Aug 2005 21:24:19 -0000
@@ -73,14 +73,16 @@
widget = GTK_WIDGET (ptr);
- /* widget should be realized before Canvas.paint is called. */
- g_assert (GTK_WIDGET_REALIZED (widget));
-
- display = gtk_widget_get_display (widget);
-
- xdisplay = GDK_DISPLAY_XDISPLAY (display);
-
- return xdisplay;
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ display = gtk_widget_get_display (widget);
+
+ xdisplay = GDK_DISPLAY_XDISPLAY (display);
+
+ return xdisplay;
+ }
+ else
+ return NULL;
}
/* Does not require locking: meant to be called after the drawing
@@ -107,12 +109,15 @@
widget = GTK_WIDGET (ptr);
- g_assert (GTK_WIDGET_REALIZED (widget));
-
- visual = gdk_x11_visual_get_xvisual (gtk_widget_get_visual (widget));
- g_assert (visual != NULL);
-
- return visual->visualid;
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ visual = gdk_x11_visual_get_xvisual (gtk_widget_get_visual (widget));
+ g_assert (visual != NULL);
+
+ return visual->visualid;
+ }
+ else
+ return NULL;
}
/* Does not require locking: meant to be called after the drawing
@@ -139,11 +144,14 @@
widget = GTK_WIDGET (ptr);
- g_assert (GTK_WIDGET_REALIZED (widget));
-
- drawable = GDK_DRAWABLE_XID (widget->window);
-
- return drawable;
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ drawable = GDK_DRAWABLE_XID (widget->window);
+
+ return drawable;
+ }
+ else
+ return NULL;
}
jint
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [cp-patches] fix GTK JAWT assertion failures,
Thomas Fitzsimmons <=