提交 cc9a8c3c 编写于 作者: D dcherepanov

6966643: GTK FileDialog hangs when user manually closes it

Reviewed-by: art
上级 4b8741eb
...@@ -42,17 +42,16 @@ static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gp ...@@ -42,17 +42,16 @@ static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gp
filename); filename);
} }
/* static void quit(gboolean isSignalHandler)
* Class: sun_awt_X11_GtkFileDialogPeer
* Method: quit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit
(JNIEnv * env, jobject jpeer)
{ {
if (dialog != NULL) if (dialog != NULL)
{ {
fp_gdk_threads_enter(); // Callbacks from GTK signals are made within the GTK lock
// So, within a signal handler there is no need to call
// gdk_threads_enter() / fp_gdk_threads_leave()
if (!isSignalHandler) {
fp_gdk_threads_enter();
}
fp_gtk_widget_hide (dialog); fp_gtk_widget_hide (dialog);
fp_gtk_widget_destroy (dialog); fp_gtk_widget_destroy (dialog);
...@@ -60,10 +59,23 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit ...@@ -60,10 +59,23 @@ JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit
fp_gtk_main_quit (); fp_gtk_main_quit ();
dialog = NULL; dialog = NULL;
fp_gdk_threads_leave(); if (!isSignalHandler) {
fp_gdk_threads_leave();
}
} }
} }
/*
* Class: sun_awt_X11_GtkFileDialogPeer
* Method: quit
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit
(JNIEnv * env, jobject jpeer)
{
quit(FALSE);
}
/** /**
* Convert a GSList to an array of filenames (without the parent folder) * Convert a GSList to an array of filenames (without the parent folder)
*/ */
...@@ -147,7 +159,7 @@ static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj) ...@@ -147,7 +159,7 @@ static void handle_response(GtkWidget* aDialog, gint responseId, gpointer obj)
jfilenames); jfilenames);
fp_g_free(current_folder); fp_g_free(current_folder);
Java_sun_awt_X11_GtkFileDialogPeer_quit(NULL, NULL); quit(TRUE);
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册