atspi: use detail value of window activated signal 46/153846/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 25 Sep 2017 13:57:02 +0000 (22:57 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Sat, 30 Sep 2017 08:48:56 +0000 (17:48 +0900)
The detail value of window activated signal is using for following cases

(1) support "default_label" attribute of window
(2) notify existing keyboard window.
The keyboard window would exist always, once it shows.
So if screen-reader turns off, and turn on again, there was no ATSPI signal.
We are using 'activate' signal for this case to get the reference of
keyboard window. And we are using detail value to reduce a call of IPC.

Change-Id: I11db347b89f283ad2ab7fd5378ca123948dbbaf5

src/lib/elm_atspi_bridge.c
src/lib/elm_win.c

index d19980e..9dfecc8 100644 (file)
@@ -218,11 +218,14 @@ static const Elm_Atspi_Bridge_Event_Handler event_handlers[] = {
    //
 };
 
+//TIZEN_ONLY(20170925) atspi: send detail value for window activated signal
 enum
 {
-  ELM_ACCESSIBLE_DEFAULT_LABEL_ENABLED = 0,
-  ELM_ACCESSIBLE_DEFAULT_LABEL_DISABLED = 1 << 0,
+  ELM_ACCESSIBLE_WINDOW_ACTIVATE_INFO_DEFAULT_LABEL_ENABLED = 0,
+  ELM_ACCESSIBLE_WINDOW_ACTIVATE_INFO_DEFAULT_LABEL_DISABLED = 1 << 0,
+  ELM_ACCESSIBLE_WINDOW_ACTIVATE_INFO_KEYBOARD = 1 << 1,
 };
+//
 
 enum _Atspi_Object_Child_Event_Type
 {
@@ -5685,10 +5688,11 @@ _move_outed_signal_send(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Descript
 }
 //
 
+//TIZEN_ONLY(20170925) atspi: send detail value for window activated signal
 static unsigned int
 _window_activated_detail_value_add(Eo *obj)
 {
-   unsigned int ret = ELM_ACCESSIBLE_DEFAULT_LABEL_ENABLED;
+   unsigned int ret = ELM_ACCESSIBLE_WINDOW_ACTIVATE_INFO_DEFAULT_LABEL_ENABLED;
    Eina_List *l, *attr_list = NULL;
    Elm_Atspi_Attribute *attr = NULL;
 
@@ -5697,15 +5701,20 @@ _window_activated_detail_value_add(Eo *obj)
      {
         if (!strcmp(attr->key, "default_label") && !strcmp(attr->value, "disabled"))
           {
-             ret |= ELM_ACCESSIBLE_DEFAULT_LABEL_DISABLED;
+             ret |= ELM_ACCESSIBLE_WINDOW_ACTIVATE_INFO_DEFAULT_LABEL_DISABLED;
              break;
           }
      }
    if (attr_list)
      elm_atspi_attributes_list_free(attr_list);
 
+   Elm_Atspi_Role role = ELM_ATSPI_ROLE_INVALID;
+   eo_do(obj, role = elm_interface_atspi_accessible_role_get());
+   if (role == ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW)
+     ret |= ELM_ACCESSIBLE_WINDOW_ACTIVATE_INFO_KEYBOARD;
    return ret;
 }
+//
 
 static Eina_Bool
 _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void *event_info EINA_UNUSED)
@@ -5740,9 +5749,11 @@ _window_signal_send(void *data, Eo *obj, const Eo_Event_Description *desc, void
         return EINA_FALSE;
      }
 
+   //TIZEN_ONLY(20170925) atspi: send detail value for window activated signal
    unsigned int det1 = 0;
    if (desc == ELM_INTERFACE_ATSPI_WINDOW_EVENT_WINDOW_ACTIVATED)
      det1 = _window_activated_detail_value_add(obj);
+   //
 
    _bridge_signal_send(data, obj, ATSPI_DBUS_INTERFACE_EVENT_WINDOW,
                        &_window_obj_signals[type], "", det1, 0, "i", 0);
index 1e20de1..f9f9e92 100644 (file)
@@ -3120,6 +3120,16 @@ _elm_win_atspi(Eina_Bool is_atspi)
                   elm_interface_atspi_window_activated_signal_emit(obj);
                   elm_interface_atspi_accessible_state_changed_signal_emit(obj, ELM_ATSPI_STATE_ACTIVE, EINA_TRUE);
                }
+             else
+               {
+                  Elm_Atspi_Role role;
+                  eo_do(obj, role = elm_interface_atspi_accessible_role_get());
+                  if (role == ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW)
+                    {
+                       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);