atspi: emit signal after atspi bridge is connected 70/148770/2
authorShinwoo Kim <cinoo.kim@samsung.com>
Sun, 10 Sep 2017 00:50:21 +0000 (09:50 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Mon, 11 Sep 2017 08:51:15 +0000 (08:51 +0000)
This patch set emitting popup SHOWING signal, and window ACTIVE signal after
the atspi bridge is connectted.

The SHOWING signal of popup does not work properly, if the popup shows before
the atspi bridge is not connected. In this case, the screen-reader cannot read
popup information. So the SHOWING signal should be emitted after the connection
is established.

The ACTIVE signal does not work properly in the following case.
There are two windows show in one process at the same time. In this case,
the ACTIVE signal was not emitted because window_activated_broadcast_needed is
set to EINA_FALSE. This would be a bug.

Change-Id: Ieb1883c94c2570fdb92b9770a1c20e7d95c27a60

src/lib/elc_popup.c
src/lib/elm_atspi_bridge.c
src/lib/elm_popup.eo
src/lib/elm_win.c

index 8cb820b47a84298a4c2522ee2d889fa1636efd35..ea6f4584312cf2178572b2cd87bd725a0167e528 100644 (file)
@@ -2241,6 +2241,20 @@ _elm_popup_elm_widget_screen_reader(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Ei
    evas_object_smart_callback_call(obj, SIG_ATSPI_SCREEN_READER_CHANGED, &is_screen_reader);
    //
 }
+
+EOLIAN static void
+_elm_popup_elm_widget_atspi(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Eina_Bool is_atspi)
+{
+   Elm_Atspi_State_Set ss;
+
+   if (!is_atspi) return;
+
+   eo_do(obj, ss = elm_interface_atspi_accessible_state_set_get());
+   if (STATE_TYPE_GET(ss, ELM_ATSPI_STATE_SHOWING))
+     {
+        elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_SHOWING, EINA_TRUE);
+     }
+}
 //
 //
 
index 2e671dece9e40df7bded1fbd755c2806b20a6798..4183fc8800075eae1c9a99f36d79a3debdb25172 100644 (file)
@@ -5351,7 +5351,11 @@ _registered_listeners_get(void *data, const Eldbus_Message *msg, Eldbus_Pending
 
    if (!pd->connected)
      {
+        //TIZEN_ONLY(20170910) atspi: emit signal after atspi bridge is connected
+        pd->connected = EINA_TRUE;
         eo_do(data, eo_event_callback_call(ELM_ATSPI_BRIDGE_EVENT_CONNECTED, NULL));
+        _elm_win_atspi(EINA_TRUE);
+        //
 
         // buid cache
         eo_do(data, root = elm_obj_atspi_bridge_root_get());
@@ -5365,8 +5369,6 @@ _registered_listeners_get(void *data, const Eldbus_Message *msg, Eldbus_Pending
 
         pd->socket_queue = pd->plug_queue = NULL;
      }
-
-   pd->connected = EINA_TRUE;
 }
 
 static void
@@ -5921,24 +5923,12 @@ _bridge_cache_build(Eo *bridge, void *obj)
      {
         if (STATE_TYPE_GET(ss, ELM_ATSPI_STATE_ACTIVE))
           {
-             // TIZEN_ONLY(20170512): send window activated event to at_spi2 only once per session
-             if(pd->window_activated_broadcast_needed)
-               {
-                  _window_signal_send(bridge, obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED, NULL);
-                  pd->window_activated_broadcast_needed = EINA_FALSE;
-               }
              // TIZEN_ONLY(20160802): do not handle events if the window is not activated
              pd->window_activated = EINA_TRUE;
              //
           }
         else
           {
-             // TIZEN_ONLY(20170512): send window activated event to at_spi2 only once per session
-             if(pd->window_activated_broadcast_needed)
-               {
-                  _window_signal_send(bridge, obj, ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_DEACTIVATED, NULL);
-                  pd->window_activated_broadcast_needed = EINA_FALSE;
-               }
              // TIZEN_ONLY(20160802): do not handle events if the window is not activated
              pd->window_activated = EINA_FALSE;
              //
@@ -6221,9 +6211,11 @@ _at_spi_client_enabled_get(void *data, const Eldbus_Message *msg, Eldbus_Pending
    if (is_enabled)
      _a11y_connection_init(data);
    else
-     DBG("AT-SPI2 stack not enabled.");
+     {
+        _elm_win_atspi(EINA_FALSE);
+        DBG("AT-SPI2 stack not enabled.");
+     }
 
-   _elm_win_atspi(is_enabled);
 }
 //
 
@@ -6477,12 +6469,14 @@ _properties_changed_cb(void *data, Eldbus_Proxy *proxy EINA_UNUSED, void *event)
              return;
           }
 
-        _elm_win_atspi(val);
 
         if (val)
           _a11y_connection_init(bridge);
         else
-          _a11y_connection_shutdown(bridge);
+          {
+             _elm_win_atspi(EINA_FALSE);
+             _a11y_connection_shutdown(bridge);
+          }
      }
    //
 }
index d318dc560b9a1999208a342f8a95c98e946c3949..81c6d7bbaab5f91a8212ae30a1ad98a836b7efcd 100644 (file)
@@ -230,6 +230,7 @@ class Elm.Popup (Elm.Layout, Elm_Interface_Atspi_Widget_Action)
       //register/unregister access objects accordingly.
       // TIZEN_ONLY(20170516): connect to at-spi dbus based on org.a11y.Status.IsEnabled property
       Elm.Widget.screen_reader;
+      Elm.Widget.atspi;
       //
       //
       Elm.Widget.focus_next;
index e7880021d8590623e7a43ce3b2b90651ade8eb60..4439b95c8fb90f1b9763a49a06dd807ed9385114 100644 (file)
@@ -3087,11 +3087,10 @@ _elm_win_atspi(Eina_Bool is_atspi)
 {
    const Eina_List *l;
    Evas_Object *obj;
+   Elm_Atspi_State_Set ss;
 
    EINA_LIST_FOREACH(_elm_win_list, l, obj)
      {
-        elm_widget_atspi(obj, is_atspi);
-
         if (!is_atspi)
           {
              ELM_WIN_DATA_GET(obj, sd);
@@ -3104,7 +3103,15 @@ _elm_win_atspi(Eina_Bool is_atspi)
         else
           {
              _atspi_socket_proxy_listen(obj);
+             eo_do(obj, ss = elm_interface_atspi_accessible_state_set_get());
+             if (STATE_TYPE_GET(ss, ELM_ATSPI_STATE_ACTIVE))
+               {
+                  elm_interface_atspi_window_activated_signal_emit(obj);
+                  elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE);
+               }
           }
+
+        elm_widget_atspi(obj, is_atspi);
      }
 }
 //