atspi: do not emit HIGHLIGHTED signal if ecore evas is obscured 47/170047/5
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 13 Feb 2018 05:29:45 +0000 (14:29 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 13 Feb 2018 12:07:34 +0000 (21:07 +0900)
The obscured application could call elm_atspi_component_highlight_grab.
The elm_atspi_component_highlight_grab emits STATE_HIGHLIGHTED signal.
This makes another visible application loses its highlight.

Example:
The "power system popup" could launch the "touch sensitivity".
Before showing the "touch sensitivity",  the "wearable home" shows for a moment.
At this poisnt, the "wearable home" tries to grab highlight.

Change-Id: I47406135e6f6c5291ef28b0ab23dda7491eebba9

src/lib/elm_access.c
src/lib/elm_atspi_bridge.c

index 40f3c97b4f45443e9d504adf495d84f4fa4a3018..81389d61d13c0d2a5c45b36ea575922a2c8967a8 100644 (file)
@@ -1525,14 +1525,14 @@ _elm_access_elm_interface_atspi_component_highlight_grab(Eo *obj, void *pd EINA_
 {
    if (!_access_action_callback_call(obj, ELM_ACCESS_ACTION_HIGHLIGHT, NULL))
      eo_do_super(obj, ELM_ACCESS_CLASS, elm_interface_atspi_component_highlight_grab());
-
+   //TIZEN_ONLY(20170717) : expose highlight information on atspi
+   else
+     elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_HIGHLIGHTED, EINA_TRUE);
+   //
    // TIZEN_ONLY(20160708) - support elm_access used for embedded toolkit
    action_by = ELM_ACCESS_ACTION_FIRST;
    //
 
-///TIZEN_ONLY(20170717) : expose highlight information on atspi
-   elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_HIGHLIGHTED, EINA_TRUE);
-///
    return EINA_TRUE;
 }
 
@@ -1541,14 +1541,13 @@ _elm_access_elm_interface_atspi_component_highlight_clear(Eo *obj, void *pd EINA
 {
    if (!_access_action_callback_call(obj, ELM_ACCESS_ACTION_UNHIGHLIGHT, NULL))
      eo_do_super(obj, ELM_ACCESS_CLASS, elm_interface_atspi_component_highlight_clear());
-
-   // TIZEN_ONLY(20160708) - support elm_access used for embedded toolkit
+   //TIZEN_ONLY(20170717) : expose highlight information on atspi
+   else
+     elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_HIGHLIGHTED, EINA_FALSE);
+   //
+   //TIZEN_ONLY(20160708) - support elm_access used for embedded toolkit
    action_by = ELM_ACCESS_ACTION_FIRST;
    //
-
-///TIZEN_ONLY(20170717) : expose highlight information on atspi
-   elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_HIGHLIGHTED, EINA_FALSE);
-///
    return EINA_TRUE;
 }
 
index c0361e2c653c755e9b4b99aabc2c0c090d57e788..7daa5e6f8dce0f56515c2282166540ab96a65739 100644 (file)
@@ -949,6 +949,23 @@ _accessible_gesture_do(const Eldbus_Service_Interface *iface, const Eldbus_Messa
 }
 //
 
+static Eina_Bool
+_ee_obscured_get(Eo *obj)
+{
+   const Ecore_Evas *ee;
+   if (eo_isa(obj, ELM_WIDGET_ITEM_CLASS))
+     {
+        Elm_Widget_Item_Data *id = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
+        ee = ecore_evas_ecore_evas_get(evas_object_evas_get(id->view));
+     }
+   else
+     {
+        ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
+     }
+
+   return ecore_evas_obscured_get(ee);
+}
+
 // TIZEN_ONLY(20170310) - implementation of get object under coordinates for accessibility
 static Eldbus_Message *
 _accessible_get_neighbor(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
@@ -974,8 +991,7 @@ _accessible_get_neighbor(const Eldbus_Service_Interface *iface EINA_UNUSED, cons
    // TIZEN_ONLY(20161213) - do not response if ecore evas is obscured
    if (root)
      {
-        const Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(root));
-        if (ecore_evas_obscured_get(ee))
+        if (_ee_obscured_get(root))
           return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "ecore evas is obscured.");
      }
    //
@@ -1015,8 +1031,7 @@ _accessible_get_navigable_at_point(const Eldbus_Service_Interface *iface EINA_UN
    ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, ELM_INTERFACE_ATSPI_ACCESSIBLE_MIXIN, msg);
 
    // TIZEN_ONLY(20161213) - do not response if ecore evas is obscured
-   const Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
-   if (ecore_evas_obscured_get(ee))
+   if (_ee_obscured_get(obj))
      return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "ecore evas is obscured.");
    //
 
@@ -4167,8 +4182,7 @@ _component_get_accessible_at_point(const Eldbus_Service_Interface *iface EINA_UN
    ELM_ATSPI_OBJ_CHECK_OR_RETURN_DBUS_ERROR(obj, ELM_INTERFACE_ATSPI_COMPONENT_MIXIN, msg);
 
    // TIZEN_ONLY(20161213) - do not response if ecore evas is obscured
-   const Ecore_Evas *ee = ecore_evas_ecore_evas_get(evas_object_evas_get(obj));
-   if (ecore_evas_obscured_get(ee))
+   if (_ee_obscured_get(obj))
      return eldbus_message_error_new(msg, "org.freedesktop.DBus.Error.Failed", "ecore evas is obscured.");
    //
 
@@ -5575,12 +5589,14 @@ _state_changed_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descr
 
    //TIZEN_ONLY(20170802): handle "gesture_required" attribute
    unsigned int det2 = 0;
-   if ((state_data->type == ELM_ATSPI_STATE_HIGHLIGHTED) &&
-       (_scroll_gesture_required_is(obj)))
-     det2++;
+   if (state_data->type == ELM_ATSPI_STATE_HIGHLIGHTED)
+     {
+        if (_ee_obscured_get(obj))
+          return EINA_FALSE;
 
-   _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_OBJECT,
-                       &_event_obj_signals[ATSPI_OBJECT_EVENT_STATE_CHANGED], type_desc, state_data->new_value, det2, NULL);
+        if (_scroll_gesture_required_is(obj))
+          det2++;
+     }
    //
    return EINA_TRUE;
 }