aboutsummaryrefslogtreecommitdiff
path: root/libjava/jni
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2003-12-16 17:20:34 +0000
committerFernando Nasser <fnasser@gcc.gnu.org>2003-12-16 17:20:34 +0000
commitaeb54188701e55f555bb8c601fd75a3e0099b91c (patch)
tree6034aeefd69ceb462af48daa185e9018d9cc0812 /libjava/jni
parent877342e5e0f81abd4eb448a3ad4ccf687de11e87 (diff)
downloadgcc-aeb54188701e55f555bb8c601fd75a3e0099b91c.zip
gcc-aeb54188701e55f555bb8c601fd75a3e0099b91c.tar.gz
gcc-aeb54188701e55f555bb8c601fd75a3e0099b91c.tar.bz2
2003-12-16 Fernando Nasser <fnasser@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (pre_event_handler): Handle GtkButton widgets differently as events go to its event_window. (connect_awt_hook): Remove compiler warning. From-SVN: r74704
Diffstat (limited to 'libjava/jni')
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
index 75eeaf7..b158e62 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
@@ -1064,6 +1064,10 @@ pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
{
obj_window = gtk_widget_get_parent (window->focus_widget)->window;
}
+ else if (GTK_IS_BUTTON (window->focus_widget))
+ /* GtkButton events go to the "event_window" and this is what
+ we registered when the button was created. */
+ obj_window = GTK_BUTTON (window->focus_widget)->event_window;
else
obj_window = window->focus_widget->window;
@@ -1164,7 +1168,7 @@ connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...)
{
va_list ap;
jobject *obj;
-void *ptr = NSA_GET_PTR (env, peer_obj);
+ //void *ptr = NSA_GET_PTR (env, peer_obj);
obj = NSA_GET_GLOBAL_REF (env, peer_obj);
//g_print("Connection obj %s\n", gtk_widget_get_name (GTK_WIDGET (ptr)));