atspi: change a method of calculating atspi VISIBLE state.
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Mon, 21 Apr 2014 03:55:28 +0000 (12:55 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Mon, 21 Apr 2014 03:55:28 +0000 (12:55 +0900)
legacy/elementary/src/lib/elm_interface_atspi_widget.c

index f408640..5f2c3ee 100644 (file)
@@ -125,13 +125,22 @@ EOLIAN static Elm_Atspi_State_Set
 _elm_interface_atspi_widget_elm_interface_atspi_accessible_state_set_get(Eo *obj, Elm_Interface_Atspi_Widget_Data *pd EINA_UNUSED)
 {
    Elm_Atspi_State_Set states = 0;
+   Evas *evas = NULL;
 
    eo_do_super(obj, ELM_INTERFACE_ATSPI_WIDGET_CLASS, states = elm_interface_atspi_accessible_state_set_get());
 
    if (evas_object_visible_get(obj))
+     STATE_TYPE_SET(states, ELM_ATSPI_STATE_VISIBLE);
+   evas = evas_object_evas_get(obj);
+   if (evas)
      {
-        STATE_TYPE_SET(states, ELM_ATSPI_STATE_VISIBLE);
-        STATE_TYPE_SET(states, ELM_ATSPI_STATE_SHOWING);
+        Evas_Coord x, y, w, h, wx, wy, ww, wh;
+
+        evas_output_viewport_get(evas, &x, &y, &w, &h);
+        evas_object_geometry_get(obj, &wx, &wy, &ww, &wh);
+        if (!(((wx < x) && (wx + ww < x)) || ((wx > x + w) && (wx + ww > x + w)) ||
+              ((wy < y) && (wy + wh < y)) || ((wy > y+ h) && (wy + wh > y + h))))
+          STATE_TYPE_SET(states, ELM_ATSPI_STATE_SHOWING);
      }
    if (elm_object_focus_get(obj))
      STATE_TYPE_SET(states, ELM_ATSPI_STATE_FOCUSED);