win: reemit atspi "focused" event on bridge connection
authorLukasz Stanislawski <l.stanislaws@samsung.com>
Wed, 28 Oct 2015 16:02:01 +0000 (17:02 +0100)
committerLukasz Stanislawski <l.stanislaws@samsung.com>
Thu, 29 Oct 2015 10:41:59 +0000 (11:41 +0100)
At-spi clients assume that object:state-changed:focused event is emitted
on application start. By the time atspi_bridge will establish
connection on at-spi bus all focused events are already emitted.
To fix this we reemit "focused" event in bridge connection callback.

This fixes a bug when Orca screen reader do not read first element after
application launch.

@fix

src/lib/elm_win.c

index 12bc7c1..f9d3e84 100644 (file)
@@ -5569,6 +5569,13 @@ _on_atspi_bus_connected(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, const Eo_Ev
         if (elm_win_focus_get(win))
           {
              elm_interface_atspi_window_activated_signal_emit(win);
+             /** Reemit focused event to inform atspi clients about currently
+              * focused object **/
+             unsigned int order = 0;
+             Evas_Object *target;
+             eo_do(win, target = elm_obj_widget_newest_focus_order_get(&order, EINA_TRUE));
+             if (target)
+               elm_interface_atspi_accessible_state_changed_signal_emit(target, ELM_ATSPI_STATE_FOCUSED, EINA_TRUE);
           }
         else
           elm_interface_atspi_window_deactivated_signal_emit(win);