atspi: emit signal after atspi bridge is connected 69/148769/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Sun, 10 Sep 2017 00:50:21 +0000 (09:50 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Sun, 10 Sep 2017 01:17:56 +0000 (10:17 +0900)
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 03ac6f8e9e1f4abea0390810cb23b214f9b8985f..9822fc2b0d1b3d33b00989eda64413af53a2bf46 100644 (file)
@@ -2238,6 +2238,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 4a9a4be350e6fca1642e77cfc9e6aeb3294b5179..d2b0d0ccb48220465a9f49726ead5f02b94e1d5c 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 95dab2081ec9c40d52f0d797d2650b3643ebf5a3..79cbd2bba96c0057eda20dd2aeeff0417ab6b3fb 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);
      }
 }
 //