Merge branch 'upstream' into tizen 90/254890/1
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Wed, 10 Mar 2021 08:50:28 +0000 (09:50 +0100)
committerBartlomiej Grzelewski <b.grzelewski@samsung.com>
Wed, 10 Mar 2021 08:50:28 +0000 (09:50 +0100)
Change-Id: Ie83d1576e026d82e7484cba6ec71cd8ed24345ae

12 files changed:
NEWS
atk-adaptor/bridge.c
atk-adaptor/bridge.h
atk-adaptor/event.c
atk-adaptor/event.h
atk-adaptor/meson.build
atk-adaptor/object.c
meson.build
meson_options.txt
subprojects/at-spi2-core.wrap [new file with mode: 0644]
subprojects/atk.wrap [new file with mode: 0644]
tests/atk_test_util.h

diff --git a/NEWS b/NEWS
index 522e06a..2462a55 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,19 @@
+What's new in at-spi2-atk 2.37.90:
+
+* Add support for the new mark and suggestion roles (!21).
+
+* Meson: add tests option (!22).
+
+What's new in at-spi2-atk 2.34.2:
+
+* Meson: don't hard-code shared_library (!19).
+
+* Mitigate missing window events at startup.
+
+* Set C standard to gnu99 (#10).
+
+* Tests: include sys/time.h (#14).
+
 What's new in at-spi2-atk 2.34.1:
 
 * socket_embed_hook: Make plug_id parameter const.
@@ -8,7 +24,7 @@ What's new in at-spi2-atk 2.34.0:
 
 What's new in at-spi2-atk 2.33.92:
 
-* License is now lGPL-2.1+.
+* License is now LGPL-2.1+.
 * Several test fixes (thanks to Samuel THibault).
 * Initialize desktop name/path early; needed since we now defer
   registration.
index a01cadc..d4a9d87 100644 (file)
@@ -408,8 +408,8 @@ register_reply (DBusPendingCall *pending, void *user_data)
     get_registered_event_listeners (spi_global_app_data);
 }
 
-gboolean
-_atk_bridge_register_application (gpointer data)
+static gboolean
+register_application (gpointer data)
 {
   SpiBridge * app = data;
   DBusMessage *message;
@@ -444,6 +444,31 @@ _atk_bridge_register_application (gpointer data)
   return FALSE;
 }
 
+void
+_atk_bridge_schedule_application_registration (SpiBridge *app)
+{
+  /* We need the callback to be called first thing, before any other of ours
+   * (and possibly of client apps), so use a high priority and a short timeout
+   * to try and be called first by the main loop. */
+  if (!app->registration_pending)
+    app->registration_pending = spi_timeout_add_full (G_PRIORITY_HIGH, 0,
+                                                      register_application,
+                                                      app, NULL);
+}
+
+gboolean
+_atk_bridge_remove_pending_application_registration (SpiBridge *app)
+{
+  if (app->registration_pending)
+  {
+    g_source_remove (app->registration_pending);
+    app->registration_pending = 0;
+    return TRUE;
+  }
+
+  return FALSE;
+}
+
 /*---------------------------------------------------------------------------*/
 
 static void
@@ -475,12 +500,8 @@ deregister_application (SpiBridge * app)
   DBusMessageIter iter;
   const char *uname;
 
-  if (spi_global_app_data->registration_pending)
-  {
-    g_source_remove (spi_global_app_data->registration_pending);
-    spi_global_app_data->registration_pending = 0;
+  if (_atk_bridge_remove_pending_application_registration (spi_global_app_data))
     return;
-  }
 
   message = dbus_message_new_method_call (SPI_DBUS_NAME_REGISTRY,
                                           ATSPI_DBUS_PATH_REGISTRY,
@@ -855,7 +876,7 @@ signal_filter (DBusConnection *bus, DBusMessage *message, void *user_data)
             {
               if (registry_lost && !old[0])
                 {
-                  _atk_bridge_register_application (spi_global_app_data);
+                  register_application (spi_global_app_data);
                   registry_lost = FALSE;
                 }
               else if (!new[0])
@@ -1110,9 +1131,8 @@ atk_bridge_adaptor_init (gint * argc, gchar ** argv[])
                               NULL);
 
   /* Register this app by sending a signal out to AT-SPI registry daemon */
-  if (!atspi_no_register && (!root || !ATK_IS_PLUG (root)) &&
-      !spi_global_app_data->registration_pending)
-    spi_global_app_data->registration_pending = spi_idle_add (_atk_bridge_register_application, spi_global_app_data);
+  if (!atspi_no_register && (!root || !ATK_IS_PLUG (root)))
+    _atk_bridge_schedule_application_registration (spi_global_app_data);
   else
     get_registered_event_listeners (spi_global_app_data);
 
index c4ceca1..9fc10fd 100644 (file)
@@ -94,7 +94,8 @@ DRoutePropertyFunction _atk_bridge_find_property_func (const char *property,
 
 GType _atk_bridge_type_from_iface (const char *iface);
 
-gboolean _atk_bridge_register_application (gpointer data);
+void _atk_bridge_schedule_application_registration (SpiBridge *app);
+gboolean _atk_bridge_remove_pending_application_registration (SpiBridge *app);
 G_END_DECLS
 
 #endif /* BRIDGE_H */
index 2f3f0e6..280973f 100644 (file)
@@ -73,11 +73,8 @@ switch_main_context (GMainContext *cnx)
   for (list = spi_global_app_data->direct_connections; list; list = list->next)
     atspi_dbus_connection_setup_with_g_main (list->data, cnx);
 
-  if (spi_global_app_data->registration_pending)
-  {
-    g_source_remove (spi_global_app_data->registration_pending);
-    spi_global_app_data->registration_pending = spi_idle_add (_atk_bridge_register_application, spi_global_app_data);
-  }
+  if (_atk_bridge_remove_pending_application_registration (spi_global_app_data))
+    _atk_bridge_schedule_application_registration (spi_global_app_data);
 }
 
 guint
@@ -108,6 +105,22 @@ spi_timeout_add_seconds (gint interval, GSourceFunc function, gpointer    data)
   return id;
 }
 
+guint
+spi_timeout_add_full (gint priority, guint interval, GSourceFunc function,
+                      gpointer data, GDestroyNotify notify)
+{
+  GSource *source;
+  guint id;
+
+  source = g_timeout_source_new (interval);
+  g_source_set_priority (source, priority);
+  g_source_set_callback (source, function, data, notify);
+  id = g_source_attach (source, spi_context);
+  g_source_unref (source);
+
+  return id;
+}
+
 static void
 set_reply (DBusPendingCall * pending, void *user_data)
 {
index 8b3b30f..fe4aad0 100644 (file)
@@ -34,4 +34,6 @@ gboolean spi_event_is_subtype (gchar **needle, gchar **haystack);
 extern GMainContext *spi_context;
 guint spi_idle_add(GSourceFunc    function, gpointer       data);
 guint spi_timeout_add_seconds (gint interval, GSourceFunc function, gpointer    data);
+guint spi_timeout_add_full (gint priority, guint interval, GSourceFunc function,
+                            gpointer data, GDestroyNotify notify);
 #endif /* EVENT_H */
index 69685e3..18d9427 100644 (file)
@@ -14,21 +14,21 @@ atk_bridge_sources = [
 
 install_headers([ 'atk-bridge.h' ], subdir: join_paths(meson.project_name(), '2.0'))
 
-libatk_bridge = shared_library('atk-bridge-2.0', atk_bridge_sources,
-                               include_directories: root_inc,
-                               dependencies: [
-                                 libatk_bridge_adaptors_dep,
-                                 libdroute_dep,
-                                 libdbus_dep,
-                                 gmodule_dep,
-                                 gobject_dep,
-                                 atk_dep,
-                                 atspi_dep,
-                               ],
-                               c_args: p2p_cflags,
-                               version: atk_bridge_libversion,
-                               soversion: atk_bridge_soversion,
-                               install: true)
+libatk_bridge = library('atk-bridge-2.0', atk_bridge_sources,
+                        include_directories: root_inc,
+                        dependencies: [
+                          libatk_bridge_adaptors_dep,
+                          libdroute_dep,
+                          libdbus_dep,
+                          gmodule_dep,
+                          gobject_dep,
+                          atk_dep,
+                          atspi_dep,
+                        ],
+                        c_args: p2p_cflags,
+                        version: atk_bridge_libversion,
+                        soversion: atk_bridge_soversion,
+                        install: true)
 
 libatk_bridge_dep = declare_dependency(link_with: libatk_bridge,
                                        include_directories: [
index 23c5d4e..d84e64e 100644 (file)
@@ -485,6 +485,8 @@ init_role_lookup_table (AtspiRole * role_table)
   role_table[ATK_ROLE_FOOTNOTE] = ATSPI_ROLE_FOOTNOTE;
   role_table[ATK_ROLE_CONTENT_DELETION] = ATSPI_ROLE_CONTENT_DELETION;
   role_table[ATK_ROLE_CONTENT_INSERTION] = ATSPI_ROLE_CONTENT_INSERTION;
+  role_table[ATK_ROLE_MARK] = ATSPI_ROLE_MARK;
+  role_table[ATK_ROLE_SUGGESTION] = ATSPI_ROLE_SUGGESTION;
 
   return TRUE;
 }
index 906dda6..33692aa 100644 (file)
@@ -1,10 +1,10 @@
 project('at-spi2-atk', 'c',
-        version: '2.34.1',
+        version: '2.38.0',
         license: 'LGPLv2.1+',
         default_options: [
           'buildtype=debugoptimized',
           'warning_level=1',
-          'c_std=c99',
+          'c_std=gnu99',
         ],
         meson_version : '>= 0.40.1')
 
@@ -38,7 +38,7 @@ libdbus_req_version = '>= 1.5'
 glib_req_version = '>= 2.32.0'
 gobject_req_version = '>= 2.0.0'
 gmodule_req_version = '>= 2.0.0'
-atk_req_version = '>= 2.33.3'
+atk_req_version = '>= 2.36.0'
 atspi_req_version = '>= 2.33.2'
 libxml_req_version = '>= 2.9.1'
 
@@ -46,8 +46,8 @@ libdbus_dep = dependency('dbus-1', version: libdbus_req_version)
 glib_dep = dependency('glib-2.0', version: glib_req_version)
 gobject_dep = dependency('gobject-2.0', version: gobject_req_version)
 gmodule_dep = dependency('gmodule-2.0', version: gmodule_req_version)
-atk_dep = dependency('atk', version: atk_req_version)
-atspi_dep = dependency('atspi-2', version: atspi_req_version)
+atk_dep = dependency('atk', version: atk_req_version, fallback : ['atk', 'libatk_dep'])
+atspi_dep = dependency('atspi-2', version: atspi_req_version, fallback : ['at-spi2-core', 'atspi_dep'])
 libxml_dep = dependency('libxml-2.0', version: libxml_req_version, required: false)
 
 if get_option('disable_p2p')
@@ -61,4 +61,6 @@ install_data('at-spi2-atk.desktop',
 
 subdir('droute')
 subdir('atk-adaptor')
-subdir('tests')
+if get_option('tests')
+  subdir('tests')
+endif
index 24c9228..a4abdc2 100644 (file)
@@ -2,3 +2,7 @@ option('disable_p2p',
        description: 'Disable peer-to-peer DBus connections',
        type: 'boolean',
        value: false)
+option('tests',
+       description: 'Whether to build tests',
+       type: 'boolean',
+       value: true)
diff --git a/subprojects/at-spi2-core.wrap b/subprojects/at-spi2-core.wrap
new file mode 100644 (file)
index 0000000..2ed1f3e
--- /dev/null
@@ -0,0 +1,5 @@
+[wrap-git]
+directory=at-spi2-core
+url=https://gitlab.gnome.org/GNOME/at-spi2-core.git
+push-url=git@gitlab.gnome.org:GNOME/at-spi2-core.git
+revision=master
diff --git a/subprojects/atk.wrap b/subprojects/atk.wrap
new file mode 100644 (file)
index 0000000..8666a3a
--- /dev/null
@@ -0,0 +1,5 @@
+[wrap-git]
+directory=atk
+url=https://gitlab.gnome.org/GNOME/atk.git
+push-url=git@gitlab.gnome.org:GNOME/atk.git
+revision=master
index d69e650..98a2c01 100644 (file)
@@ -26,6 +26,7 @@
 
 #include <stdio.h>
 #include <unistd.h>
+#include <sys/time.h>
 #include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>