This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: hack to prevent X race condition


Hello,

I'm committing this patch.  It is a temporary hack to prevent an X
event-related race condition that was causing crashes.  I'm working on a
new patch that will address the FIXME.

Tom

2003-12-01  Thomas Fitzsimmons  <fitzsim@redhat.com>

	* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
	(awt_event_handler): Hard-code inset values.


Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
===================================================================
RCS file:
/cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,v
retrieving revision 1.9
diff -u -r1.9 gnu_java_awt_peer_gtk_GtkEvents.c
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c	9 Oct 2003 00:26:29
-0000	1.9
+++ jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c	1 Dec 2003 23:17:20
-0000
@@ -1022,8 +1022,6 @@
 	    if (widget && GTK_WIDGET_TOPLEVEL (widget))
 	      {
 		gint top, left, right, bottom;
-		gint x, y, w, h, d;
-		GdkRectangle r;
 
 		/* Configure events are not posted to the AWT event
 		   queue, and as such, the gdk/gtk peer functions will
@@ -1031,20 +1029,11 @@
 		   returns. */
 		gdk_threads_leave ();
 
-		/* Calculate our insets. */
-
-		/* When called from within the gdk_threads critical
-		   section these functions seem to return strange
-		   results, so we call them after
-		   gdk_threads_leave. */
-		gdk_window_get_geometry (event->any.window,
-					 &x, &y, &w, &h, &d);
-		gdk_window_get_frame_extents (event->any.window, &r);
-
-		top = y;
-		left = x;
-		bottom = r.height - h - y;
-		right = r.width - w - x;
+		/* FIXME: hard-code these values for now. */
+		top = 20;
+		left = 6;
+		bottom = 6;
+		right = 6;
 
 		(*gdk_env)->CallVoidMethod (gdk_env, *event_obj_ptr,
 					    postConfigureEventID,



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]