summaryrefslogtreecommitdiff
path: root/native/jni
diff options
context:
space:
mode:
authorFrancis Kung <fkung@redhat.com>2007-08-23 20:09:53 +0000
committerFrancis Kung <fkung@redhat.com>2007-08-23 20:09:53 +0000
commit0f4f3173af3d484ba9588e04949e3b07b19f95a7 (patch)
tree034c832f9d1a7b5448410a89b5ff4c6764dc7795 /native/jni
parent1245647bdc1738cd03a8dcc856fbd8a87c95a772 (diff)
downloadclasspath-0f4f3173af3d484ba9588e04949e3b07b19f95a7.tar.gz
2007-08-23 Francis Kung <fkung@redhat.com>
* gnu/java/awt/peer/gtk/GtkComponentPeer.java: (getLocationOnScreen): Check for GTK main thread. (gtkWidgetGetLocationOnScreenUnlocked): New native method. (gtkWindowGetLocationOnScreenUnlocked): New native method. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c: (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWindowGetLocationOnScreen): Delegate to unlocked function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWindowGetLocationOnScreenUnlocked): New function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreen): Delegate to unlocked function. (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreenUnlocked): New function.
Diffstat (limited to 'native/jni')
-rw-r--r--native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c32
1 files changed, 24 insertions, 8 deletions
diff --git a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index 8dbf25a5a..5de5d82a6 100644
--- a/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -517,19 +517,27 @@ JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWindowGetLocationOnScreen
(JNIEnv * env, jobject obj, jintArray jpoint)
{
+ gdk_threads_enter();
+
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWindowGetLocationOnScreenUnlocked
+ (env, obj, jpoint);
+
+ gdk_threads_leave();
+
+}
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWindowGetLocationOnScreenUnlocked
+ (JNIEnv * env, jobject obj, jintArray jpoint)
+{
void *ptr;
jint *point;
- gdk_threads_enter ();
-
ptr = gtkpeer_get_widget (env, obj);
point = (*env)->GetIntArrayElements (env, jpoint, 0);
gdk_window_get_root_origin (get_widget(GTK_WIDGET (ptr))->window, point, point+1);
(*env)->ReleaseIntArrayElements(env, jpoint, point, 0);
-
- gdk_threads_leave ();
}
/*
@@ -539,12 +547,22 @@ JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreen
(JNIEnv * env, jobject obj, jintArray jpoint)
{
+ gdk_threads_enter();
+
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreenUnlocked
+ (env, obj, jpoint);
+
+ gdk_threads_leave();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreenUnlocked
+ (JNIEnv * env, jobject obj, jintArray jpoint)
+{
void *ptr;
jint *point;
GtkWidget *widget;
- gdk_threads_enter ();
-
ptr = gtkpeer_get_widget (env, obj);
point = (*env)->GetIntArrayElements (env, jpoint, 0);
@@ -557,8 +575,6 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreen
*(point+1) += GTK_WIDGET(ptr)->allocation.y;
(*env)->ReleaseIntArrayElements(env, jpoint, point, 0);
-
- gdk_threads_leave ();
}
/*