[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: peer fixes

Kaffe CVS cvs-commits at kaffe.org
Sun Feb 13 14:40:43 PST 2005


PatchSet 5531 
Date: 2005/02/13 22:32:04
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: peer fixes

2005-02-13  Dalibor Topic  <robilad at kaffe.org>

        Resynced with GNU Classpath.

        2005-02-10  Graydon Hoare  <graydon at redhat.com>

        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,
        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,
        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c,
        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
        Release GDK lock during upcalls.

Members: 
	ChangeLog:1.3575->1.3576 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.10->1.11 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.6->1.7 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.4->1.5 
	libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.12->1.13 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3575 kaffe/ChangeLog:1.3576
--- kaffe/ChangeLog:1.3575	Sun Feb 13 22:29:44 2005
+++ kaffe/ChangeLog	Sun Feb 13 22:32:04 2005
@@ -2,6 +2,18 @@
 
 	Resynced with GNU Classpath.
 
+	2005-02-10  Graydon Hoare  <graydon at redhat.com>
+
+        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,
+        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c,
+        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c,
+        jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:
+        Release GDK lock during upcalls.
+
+2005-02-13  Dalibor Topic  <robilad at kaffe.org>
+
+	Resynced with GNU Classpath.
+
 	2005-02-10  Michael Koch  <konqueror at gmx.de>
 
         * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c:
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.10 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.11
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c:1.10	Sat Jan 22 18:25:01 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c	Sun Feb 13 22:32:09 2005
@@ -1054,10 +1054,12 @@
              GdkEventFocus *event __attribute((unused)),
              jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                               postFocusEventID,
                               AWT_FOCUS_GAINED,
                               JNI_FALSE);
+  gdk_threads_enter ();
   return FALSE;
 }
 
@@ -1066,9 +1068,11 @@
               GdkEventFocus *event __attribute((unused)),
               jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                               postFocusEventID,
                               AWT_FOCUS_LOST,
                               JNI_FALSE);
+  gdk_threads_enter ();
   return FALSE;
 }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.6 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.7
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c:1.6	Sat Jan 22 18:25:01 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c	Sun Feb 13 22:32:10 2005
@@ -883,6 +883,7 @@
   switch (event->type)
     {
     case GDK_BUTTON_PRESS:
+      gdk_threads_leave ();
       (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                                   postMouseEventID,
 				  AWT_MOUSE_PRESSED, 
@@ -894,12 +895,14 @@
 				  click_count, 
 				  (event->button.button == 3) ? JNI_TRUE :
 				                                JNI_FALSE);
+      gdk_threads_enter ();
       hasBeenDragged = FALSE;
       break;
     case GDK_BUTTON_RELEASE:
       {
 	int width, height;
 
+	gdk_threads_leave ();
 	(*gdk_env())->CallVoidMethod (gdk_env(), peer,
 				    postMouseEventID,
 				    AWT_MOUSE_RELEASED, 
@@ -910,6 +913,7 @@
 				    (jint)event->button.y, 
 				    click_count,
 				    JNI_FALSE);
+	gdk_threads_enter ();
 
 	/* Generate an AWT click event only if the release occured in the
 	   window it was pressed in, and the mouse has not been dragged since
@@ -921,6 +925,7 @@
 	    && event->button.x <= width 
 	    && event->button.y <= height)
           {
+	    gdk_threads_leave ();
 	    (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 				        postMouseEventID,
 				        AWT_MOUSE_CLICKED, 
@@ -931,6 +936,7 @@
 				        (jint)event->button.y, 
 				        click_count,
 				        JNI_FALSE);
+	    gdk_threads_enter ();
           }
       }
       break;
@@ -941,6 +947,7 @@
 				 | GDK_BUTTON4_MASK
 				 | GDK_BUTTON5_MASK))
 	{
+	  gdk_threads_leave ();
 	  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 			              postMouseEventID,
 				      AWT_MOUSE_DRAGGED,
@@ -950,44 +957,58 @@
 				      (jint)event->motion.y,
 				      0,
 				      JNI_FALSE);
+	  gdk_threads_enter ();
 	  hasBeenDragged = TRUE;
 	}
       else
-        (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
-				    AWT_MOUSE_MOVED,
-				    (jlong)event->motion.time,
-				    state_to_awt_mods (event->motion.state),
-				    (jint)event->motion.x,
-				    (jint)event->motion.y,
-				    0,
-				    JNI_FALSE);
+	{
+	  gdk_threads_leave ();
+	  (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
+					AWT_MOUSE_MOVED,
+					(jlong)event->motion.time,
+					state_to_awt_mods (event->motion.state),
+					(jint)event->motion.x,
+					(jint)event->motion.y,
+					0,
+					JNI_FALSE);
+	  gdk_threads_enter ();
+	}
+
       break;
     case GDK_ENTER_NOTIFY:
       /* We are not interested in enter events that are due to
          grab/ungrab and not to actually crossing boundaries */
       if (event->crossing.mode == GDK_CROSSING_NORMAL)
-        (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
-				    AWT_MOUSE_ENTERED, 
-				    (jlong)event->crossing.time,
-				    state_to_awt_mods_with_button_states (event->crossing.state), 
-				    (jint)event->crossing.x,
-				    (jint)event->crossing.y, 
-				    0,
-				    JNI_FALSE);
+	{
+	  gdk_threads_leave ();	  
+	  (*gdk_env())->CallVoidMethod (gdk_env(), peer, postMouseEventID,
+					AWT_MOUSE_ENTERED, 
+					(jlong)event->crossing.time,
+					state_to_awt_mods_with_button_states (event->crossing.state), 
+					(jint)event->crossing.x,
+					(jint)event->crossing.y, 
+					0,
+					JNI_FALSE);
+	  gdk_threads_enter ();
+	}
       break;
     case GDK_LEAVE_NOTIFY:
       /* We are not interested in leave events that are due to
          grab/ungrab and not to actually crossing boundaries */
       if (event->crossing.mode == GDK_CROSSING_NORMAL)
-	(*gdk_env())->CallVoidMethod (gdk_env(), peer,
-				    postMouseEventID,
-				    AWT_MOUSE_EXITED, 
-				    (jlong)event->crossing.time,
-				    state_to_awt_mods_with_button_states (event->crossing.state),
-				    (jint)event->crossing.x,
-				    (jint)event->crossing.y, 
-				    0,
-				    JNI_FALSE);
+	{
+	  gdk_threads_leave ();	  
+	  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+					postMouseEventID,
+					AWT_MOUSE_EXITED, 
+					(jlong)event->crossing.time,
+					state_to_awt_mods_with_button_states (event->crossing.state),
+					(jint)event->crossing.x,
+					(jint)event->crossing.y, 
+					0,
+					JNI_FALSE);
+	  gdk_threads_enter ();	  
+	}
       break;
     case GDK_CONFIGURE:
       {
@@ -1012,20 +1033,24 @@
       }
       break;
     case GDK_EXPOSE:
+      gdk_threads_leave ();
       (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                                   postExposeEventID,
                                   (jint)event->expose.area.x,
                                   (jint)event->expose.area.y,
                                   (jint)event->expose.area.width,
                                   (jint)event->expose.area.height);
+      gdk_threads_enter ();
       break;
 
     case GDK_FOCUS_CHANGE:
+      gdk_threads_leave ();
       (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 				  postFocusEventID,
 				  (jint) (event->focus_change.in) ?
 				  AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
 				  JNI_FALSE);
+      gdk_threads_enter ();
       break;
     case GDK_KEY_PRESS:
         if (GTK_IS_WINDOW (widget))
@@ -1033,6 +1058,7 @@
             /*            GdkEventKey *keyevent = (GdkEventKey *) event; */
             /*            g_printerr ("key press event: sent: %d  time: %d  state: %d  keyval: %d  length: %d  string: %s  hardware_keycode: %d  group: %d\n", keyevent->send_event, keyevent->time, keyevent->state, keyevent->keyval, keyevent->length, keyevent->string, keyevent->hardware_keycode, keyevent->group); */
 
+	    gdk_threads_leave ();
             (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                                         postKeyEventID,
                                         (jint) AWT_KEY_PRESSED,
@@ -1041,6 +1067,7 @@
                                         keysym_to_awt_keycode (event),
                                         keyevent_to_awt_keychar (event),
                                         keysym_to_awt_keylocation (event));
+	    gdk_threads_enter ();
             /* FIXME: generation of key typed events needs to be moved
                to GtkComponentPeer.postKeyEvent.  If the key in a key
                press event is not an "action" key
@@ -1054,6 +1081,7 @@
     case GDK_KEY_RELEASE:
       if (GTK_IS_WINDOW (widget))
         {
+	    gdk_threads_leave ();
             (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                                         postKeyEventID,
                                         (jint) AWT_KEY_RELEASED,
@@ -1062,6 +1090,7 @@
                                         keysym_to_awt_keycode (event),
                                         keyevent_to_awt_keychar (event),
                                         keysym_to_awt_keylocation (event));
+	    gdk_threads_enter ();
             return TRUE;
         }
       else
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.4 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.5
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:1.4	Sat Jan 22 18:25:07 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c	Sun Feb 13 22:32:12 2005
@@ -492,5 +492,7 @@
 textcomponent_changed_cb (GtkEditable *editable __attribute__((unused)),
 			  jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer, postTextEventID);
+  gdk_threads_enter ();
 }
Index: kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
diff -u kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.12 kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.13
--- kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c:1.12	Sat Jan 22 18:25:08 2005
+++ kaffe/libraries/clib/awt/classpath-gtk/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c	Sun Feb 13 22:32:12 2005
@@ -493,10 +493,12 @@
 		  GdkEvent *event __attribute__((unused)),
 		  jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 			      postWindowEventID,
 			      (jint) AWT_WINDOW_CLOSING,
 			      (jobject) NULL, (jint) 0);
+  gdk_threads_enter ();
 }
 
 static void
@@ -504,20 +506,24 @@
 		   GdkEvent *event __attribute__((unused)),
 		   jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 			      postWindowEventID,
 			      (jint) AWT_WINDOW_CLOSED,
 			      (jobject) NULL, (jint) 0);
+  gdk_threads_enter ();
 }
 
 static void
 window_show_cb (GtkWidget *widget __attribute__((unused)),
 		jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 			      postWindowEventID,
 			      (jint) AWT_WINDOW_OPENED,
 			      (jobject) NULL, (jint) 0);
+  gdk_threads_enter ();
 }
 
 static void
@@ -528,6 +534,7 @@
   /* FIXME: not sure if this is needed or not. */
   /* Remove the unused attributes if you fix the below.  */
 #if 0
+  gdk_threads_leave ();
   if (GTK_WINDOW (widget)->is_active)
     (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                                 postWindowEventID,
@@ -538,6 +545,7 @@
                                 postWindowEventID,
                                 (jint) AWT_WINDOW_DEACTIVATED,
                                 (jobject) NULL, (jint) 0);
+  gdk_threads_enter ();
 #endif
 }
 
@@ -546,6 +554,7 @@
 			      GParamSpec *pspec __attribute__((unused)),
 			      jobject peer)
 {
+  gdk_threads_leave ();
   if (GTK_WINDOW (widget)->has_toplevel_focus)
     (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                                 postWindowEventID,
@@ -556,6 +565,7 @@
                                 postWindowEventID,
                                 (jint) AWT_WINDOW_DEACTIVATED,
                                 (jobject) NULL, (jint) 0);
+  gdk_threads_enter ();
 }
 
 static gboolean
@@ -563,12 +573,14 @@
 		    GdkEventFocus *event  __attribute__((unused)),
 		    jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                               postWindowEventID,
                               (jint) AWT_WINDOW_GAINED_FOCUS,
                               (jobject) NULL, (jint) 0);
   /* FIXME: somewhere after this is handled, the child window is
      getting an expose event. */
+  gdk_threads_enter ();
   return FALSE;
 }
 
@@ -577,12 +589,14 @@
 		     GdkEventFocus *event __attribute__((unused)),
 		     jobject peer)
 {
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
                               postWindowEventID,
                               (jint) AWT_WINDOW_LOST_FOCUS,
                               (jobject) NULL, (jint) 0);
   /* FIXME: somewhere after this is handled, the child window is
      getting an expose event. */
+  gdk_threads_enter ();
   return FALSE;
 }
 
@@ -600,18 +614,22 @@
       if (event->window_state.new_window_state & GDK_WINDOW_STATE_ICONIFIED)
 	{
 	  /* We've been iconified. */
+	  gdk_threads_leave ();
 	  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 				      postWindowEventID,
 				      (jint) AWT_WINDOW_ICONIFIED,
 				      (jobject) NULL, (jint) 0);
+	  gdk_threads_enter ();
 	}
       else
 	{
 	  /* We've been deiconified. */
+	  gdk_threads_leave ();
 	  (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 				      postWindowEventID,
 				      (jint) AWT_WINDOW_DEICONIFIED,
 				      (jobject) NULL, (jint) 0);
+	  gdk_threads_enter ();
 	}
     }
 
@@ -624,10 +642,12 @@
 
   new_state |= window_get_new_state (widget);
 
+  gdk_threads_leave ();
   (*gdk_env())->CallVoidMethod (gdk_env(), peer,
 			      postWindowEventID,
 			      (jint) AWT_WINDOW_STATE_CHANGED,
 			      (jobject) NULL, new_state);
+  gdk_threads_enter ();
   return TRUE;
 }
 
@@ -705,12 +725,17 @@
                            NULL,
                            NULL,
                            gu_ex.gu_extents))
-    (*gdk_env())->CallVoidMethod (gdk_env(), peer,
-				postInsetsChangedEventID,
-				(jint) extents[2],  /* top */
-				(jint) extents[0],  /* left */
-				(jint) extents[3],  /* bottom */
-				(jint) extents[1]); /* right */
+    {
+      gdk_threads_leave ();
+      (*gdk_env())->CallVoidMethod (gdk_env(), peer,
+				    postInsetsChangedEventID,
+				    (jint) extents[2],  /* top */
+				    (jint) extents[0],  /* left */
+				    (jint) extents[3],  /* bottom */
+				    (jint) extents[1]); /* right */
+      gdk_threads_enter ();
+    }
+  
 
   return FALSE;
 }




More information about the kaffe mailing list