6998592: FileDialog tests crashed on solaris
Summary: Override GtkFileDialogPeer.toFront()
Reviewed-by: art, dcherepanov
--- a/jdk/make/sun/xawt/mapfile-vers Fri Nov 26 15:52:55 2010 +0300
+++ b/jdk/make/sun/xawt/mapfile-vers Tue Nov 30 17:36:56 2010 +0300
@@ -432,6 +432,7 @@
Java_sun_awt_X11_GtkFileDialogPeer_initIDs;
Java_sun_awt_X11_GtkFileDialogPeer_run;
Java_sun_awt_X11_GtkFileDialogPeer_quit;
+ Java_sun_awt_X11_GtkFileDialogPeer_toFront;
Java_sun_print_CUPSPrinter_initIDs;
Java_sun_print_CUPSPrinter_getCupsServer;
--- a/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java Fri Nov 26 15:52:55 2010 +0300
+++ b/jdk/src/solaris/classes/sun/awt/X11/GtkFileDialogPeer.java Tue Nov 30 17:36:56 2010 +0300
@@ -57,8 +57,11 @@
private native void run(String title, int mode, String dir, String file,
FilenameFilter filter, boolean isMultipleMode);
+ private native void quit();
- private native void quit();
+ @Override
+ public native void toFront();
+
/**
* Called exclusively by the native C code.
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c Fri Nov 26 15:52:55 2010 +0300
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c Tue Nov 30 17:36:56 2010 +0300
@@ -607,6 +607,7 @@
fp_gtk_tree_view_new = dl_symbol("gtk_tree_view_new");
fp_gtk_viewport_new = dl_symbol("gtk_viewport_new");
fp_gtk_window_new = dl_symbol("gtk_window_new");
+ fp_gtk_window_present = dl_symbol("gtk_window_present");
fp_gtk_dialog_new = dl_symbol("gtk_dialog_new");
fp_gtk_frame_new = dl_symbol("gtk_frame_new");
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.h Fri Nov 26 15:52:55 2010 +0300
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h Tue Nov 30 17:36:56 2010 +0300
@@ -749,6 +749,7 @@
int (*fp_gdk_pixbuf_get_width)(const GdkPixbuf *pixbuf);
GdkPixbuf *(*fp_gdk_pixbuf_new_from_file)(const char *filename, GError **error);
void (*fp_gtk_widget_destroy)(GtkWidget *widget);
+void (*fp_gtk_window_present)(GtkWindow *window);
/**
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c Fri Nov 26 15:52:55 2010 +0300
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.c Tue Nov 30 17:36:56 2010 +0300
@@ -80,6 +80,28 @@
quit(env, jpeer, FALSE);
}
+/*
+ * Class: sun_awt_X11_GtkFileDialogPeer
+ * Method: toFront
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront
+(JNIEnv * env, jobject jpeer)
+{
+ GtkWidget * dialog;
+
+ fp_gdk_threads_enter();
+
+ dialog = (GtkWidget*)jlong_to_ptr(
+ (*env)->GetLongField(env, jpeer, widgetFieldID));
+
+ if (dialog != NULL) {
+ fp_gtk_window_present((GtkWindow*)dialog);
+ }
+
+ fp_gdk_threads_leave();
+}
+
/**
* Convert a GSList to an array of filenames (without the parent folder)
*/
--- a/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h Fri Nov 26 15:52:55 2010 +0300
+++ b/jdk/src/solaris/native/sun/awt/sun_awt_X11_GtkFileDialogPeer.h Tue Nov 30 17:36:56 2010 +0300
@@ -33,6 +33,14 @@
JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_quit
(JNIEnv *, jobject);
+/*
+ * Class: sun_awt_X11_GtkFileDialogPeer
+ * Method: toFront
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_toFront
+(JNIEnv *, jobject);
+
#ifdef __cplusplus
}
#endif