[java-atk-wrapper: 1/2] Fix atk event parameters



commit 664dc376720f852a214b6cf66647ba9d1a1d5de1
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Wed May 1 22:26:32 2019 +0000

    Fix atk event parameters
    
    glib signals have a determined number of parameters, giving an extra 0 is
    not useful, and missing parameters are of course a problem :) The attached
    patch fixes the existing mismatches. For bounds_changed, the bogus values
    could be problematic. It happens that orca actually ignores this kind of
    event, so it will not be bothered. Provide a (even bogus) parameter is
    however needed for proper marshalling etc. otherwise undefined behavior
    would happen.
    
    Fixes https://bugzilla.gnome.org/show_bug.cgi?id=793821

 jni/src/AtkWrapper.c | 29 ++++++++++++++++-------------
 1 file changed, 16 insertions(+), 13 deletions(-)
---
diff --git a/jni/src/AtkWrapper.c b/jni/src/AtkWrapper.c
index 5a0fb95..e38bba7 100644
--- a/jni/src/AtkWrapper.c
+++ b/jni/src/AtkWrapper.c
@@ -331,10 +331,9 @@ window_open_handler (gpointer p)
     g_signal_emit_by_name(ATK_OBJECT(atk_get_root()),
                           "children-changed::add",
                           n,
-                          atk_obj,
-                          NULL);
+                          atk_obj);
 
-    g_signal_emit_by_name(atk_obj, "create", 0);
+    g_signal_emit_by_name(atk_obj, "create");
   }
 
   queue_free_callback_para(para);
@@ -387,10 +386,9 @@ window_close_handler (gpointer p)
     g_signal_emit_by_name(ATK_OBJECT(atk_get_root()),
                           "children-changed::remove",
                           n,
-                          atk_obj,
-                          NULL);
+                          atk_obj);
 
-    g_signal_emit_by_name(atk_obj, "destroy", 0);
+    g_signal_emit_by_name(atk_obj, "destroy");
   }
 
   queue_free_callback_para(para);
@@ -422,7 +420,7 @@ window_minimize_handler (gpointer p)
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
 
-  g_signal_emit_by_name(atk_obj, "minimize", 0);
+  g_signal_emit_by_name(atk_obj, "minimize");
 
   queue_free_callback_para(para);
 
@@ -451,7 +449,7 @@ window_maximize_handler (gpointer p)
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
 
-  g_signal_emit_by_name(atk_obj, "maximize", 0);
+  g_signal_emit_by_name(atk_obj, "maximize");
 
   queue_free_callback_para(para);
 
@@ -479,7 +477,7 @@ window_restore_handler (gpointer p)
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
 
-  g_signal_emit_by_name(atk_obj, "restore", 0);
+  g_signal_emit_by_name(atk_obj, "restore");
 
   queue_free_callback_para(para);
 
@@ -507,7 +505,7 @@ window_activate_handler (gpointer p)
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
 
-  g_signal_emit_by_name(atk_obj, "activate", 0);
+  g_signal_emit_by_name(atk_obj, "activate");
 
   queue_free_callback_para(para);
 
@@ -535,7 +533,7 @@ window_deactivate_handler (gpointer p)
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
 
-  g_signal_emit_by_name(atk_obj, "deactivate", 0);
+  g_signal_emit_by_name(atk_obj, "deactivate");
 
   queue_free_callback_para(para);
 
@@ -564,7 +562,7 @@ window_state_change_handler (gpointer p)
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
 
-  g_signal_emit_by_name(atk_obj, "state-change", 0);
+  g_signal_emit_by_name(atk_obj, "state-change", 0, 0);
 
   queue_free_callback_para(para);
 
@@ -1012,6 +1010,7 @@ bounds_changed_handler (gpointer p)
 {
   CallbackPara *para = (CallbackPara*)p;
   AtkObject* atk_obj = ATK_OBJECT(para->jaw_impl);
+  AtkRectangle rect;
 
   if (atk_obj == NULL)
   {
@@ -1020,7 +1019,11 @@ bounds_changed_handler (gpointer p)
     queue_free_callback_para(para);
     return G_SOURCE_REMOVE;
   }
-  g_signal_emit_by_name(atk_obj, "bounds_changed");
+  rect.x = -1;
+  rect.y = -1;
+  rect.width = -1;
+  rect.height = -1;
+  g_signal_emit_by_name(atk_obj, "bounds_changed", &rect);
   queue_free_callback_para(para);
 
   return G_SOURCE_REMOVE;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]