This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for handling of key events by Button widgets


For the record, here is the patch with Tom's suggestion that I am checking in.

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.




-- Fernando Nasser Red Hat Canada Ltd. E-Mail: fnasser@redhat.com 2323 Yonge Street, Suite #300 Toronto, Ontario M4P 2C9
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2445
diff -c -p -r1.2445 ChangeLog
*** ChangeLog	16 Dec 2003 13:44:59 -0000	1.2445
--- ChangeLog	16 Dec 2003 17:16:58 -0000
***************
*** 1,3 ****
--- 1,10 ----
+ 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.
+ 
  i2003-12-16  Guilhem Lavaux <guilhem@kaffe.org>
  
  	* java/io/ObjectInputStream.java
Index: jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
===================================================================
RCS file: /cvs/gcc/gcc/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c,v
retrieving revision 1.13
diff -c -p -r1.13 gnu_java_awt_peer_gtk_GtkEvents.c
*** jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c	13 Dec 2003 01:15:47 -0000	1.13
--- jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c	16 Dec 2003 17:16:59 -0000
*************** pre_event_handler (GtkWidget *widget, Gd
*** 1064,1069 ****
--- 1064,1073 ----
                {
                  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;
  
*************** connect_awt_hook (JNIEnv *env, jobject p
*** 1164,1170 ****
  {
    va_list ap;
    jobject *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)));
--- 1168,1174 ----
  {
    va_list ap;
    jobject *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)));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]