Hi list,

I merged the attached patch from GCC.


Michael


Tom's messgae was:

This patch fixes the GTK FileDialog peer crashes.  gnome-vfs's
cancellation code is not thread-safe and we were calling it from
multiple threads.  This caused gnome_vfs_is_primary_thread to fail,
triggering an assertion failure in gnome_vfs_cancellation_cancel.  I've
reported the problem to the gnome-vfs maintainers and they're working on
a solution.  In the mean time, I've fallen back to using GTK's built-in
file chooser backend which is independent from gnome-vfs.  When the
cancellation functions are made thread-safe, we can start using the
gnome-vfs backend again.  The GTK error messages seem to have been
caused by setting the "show_hidden" property -- by default, hidden files
should be hidden in the file selector anyway, so I've removed that line.


2005-02-11  Thomas Fitzsimmons  <[EMAIL PROTECTED]>

        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c (create):
        Use GTK's built-in file system backend.  Use GTK_RESPONSE_ACCEPT.
        (handle_response): Use GTK_RESPONSE_ACCEPT.

Index: native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
===================================================================
RCS file: 
/cvsroot/classpath/classpath/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c,v
retrieving revision 1.18
diff -u -r1.18 gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
--- native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c       19 Jan 
2005 08:10:27 -0000      1.18
+++ native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c       11 Feb 
2005 07:41:27 -0000
@@ -62,15 +62,17 @@
 
   gdk_threads_enter ();
   
-  widget = gtk_file_chooser_dialog_new("",
-                                       GTK_WINDOW(parentp),
-                                       GTK_FILE_CHOOSER_ACTION_OPEN,
-                                       GTK_STOCK_OK, GTK_RESPONSE_OK,
-                                       GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                                       NULL);
-
-  /* GtkFileChooser doesn't show hidden files by default. */
-  g_object_set(GTK_FILE_CHOOSER(widget), "show_hidden", TRUE);
+  /* FIXME: we should be using the default gnome-vfs backend but it is
+     not currently thread-safe.  See:
+     http://bugzilla.gnome.org/show_bug.cgi?id=166852 */
+  widget = gtk_file_chooser_dialog_new_with_backend
+    ("Open File",
+     GTK_WINDOW(parentp),
+     GTK_FILE_CHOOSER_ACTION_OPEN,
+     "gtk+",
+     GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+     GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+     NULL);
 
   /* GtkFileSelect is not modal by default */
   gtk_window_set_modal (GTK_WINDOW (widget), TRUE);
@@ -221,7 +223,7 @@
   /* We only need this for the case when the user closed the window,
      or clicked ok or cancel. */
   if (responseId != GTK_RESPONSE_DELETE_EVENT
-      && responseId != GTK_RESPONSE_OK
+      && responseId != GTK_RESPONSE_ACCEPT
       && responseId != GTK_RESPONSE_CANCEL)
     return;
 
@@ -245,7 +247,7 @@
     return;
   }
 
-  if (responseId == GTK_RESPONSE_OK) {
+  if (responseId == GTK_RESPONSE_ACCEPT) {
     fileName = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (GTK_WIDGET 
(ptr)));
     str_fileName = (*gdk_env())->NewStringUTF (gdk_env(), fileName);
   }
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to