< prev index next >
src/java.desktop/unix/native/libawt_xawt/awt/sun_awt_X11_GtkFileDialogPeer.c
Print this page
*** 25,34 ****
--- 25,35 ----
#include <jni.h>
#include <stdio.h>
#include <jni_util.h>
#include <string.h>
+ #include <X11/X.h>
#include "gtk2_interface.h"
#include "sun_awt_X11_GtkFileDialogPeer.h"
#include "java_awt_FileDialog.h"
#include "debug_assert.h"
*** 36,45 ****
--- 37,47 ----
/* To cache some method IDs */
static jmethodID filenameFilterCallbackMethodID = NULL;
static jmethodID setFileInternalMethodID = NULL;
static jfieldID widgetFieldID = NULL;
+ static jmethodID setWindowMethodID = NULL;
JNIEXPORT void JNICALL Java_sun_awt_X11_GtkFileDialogPeer_initIDs
(JNIEnv *env, jclass cx)
{
filenameFilterCallbackMethodID = (*env)->GetMethodID(env, cx,
*** 52,61 ****
--- 54,67 ----
DASSERT(setFileInternalMethodID != NULL);
CHECK_NULL(setFileInternalMethodID);
widgetFieldID = (*env)->GetFieldID(env, cx, "widget", "J");
DASSERT(widgetFieldID != NULL);
+
+ setWindowMethodID = (*env)->GetMethodID(env, cx, "setWindow", "(J)Z");
+ DASSERT(setWindowMethodID != NULL);
+ CHECK_NULL(setWindowMethodID);
}
static gboolean filenameFilterCallback(const GtkFileFilterInfo * filter_info, gpointer obj)
{
JNIEnv *env;
*** 399,407 ****
--- 405,417 ----
(*env)->SetLongField(env, jpeer, widgetFieldID, ptr_to_jlong(dialog));
fp_gtk_widget_show(dialog);
+ XID xid = fp_gdk_x11_drawable_get_xid(dialog->window);
+ if( (*env)->CallBooleanMethod(env, jpeer, setWindowMethodID, xid) ) {
fp_gtk_main();
+ }
+
fp_gdk_threads_leave();
}
< prev index next >