[Screen-Reader]: If keyboard receives events, do not process events at screen-reader... 14/76614/3
authorShilpa Singh <shilpa.singh@samsung.com>
Fri, 24 Jun 2016 11:49:01 +0000 (17:19 +0530)
committerShilpa Singh <shilpa.singh@samsung.com>
Fri, 24 Jun 2016 12:00:26 +0000 (17:30 +0530)
fixes: unnecessary activate being sent on highlighted widget when activation happens in keyboard.
Test: Double tap on spinner, entry is shown, now select any number by double tapping on keyboard, the number should get entered in to spinner.

Change-Id: I0efddbebf61aa62030dfa121f59867af313793e2
Signed-off-by: Shilpa Singh <shilpa.singh@samsung.com>
include/keyboard_tracker.h
src/app_tracker.c
src/flat_navi.c
src/keyboard_tracker.c
src/navigator.c

index 02e470c5bd6dd8d63b5264ae87ec458a87b4a0b7..d4f27f754946b481d690a0b7c5a95eb63be70590 100644 (file)
@@ -15,3 +15,8 @@ typedef enum _Key Key;
 typedef void (*Keyboard_Tracker_Cb) (void *data, Key k);
 void keyboard_tracker_init(void);
 void keyboard_tracker_shutdown(void);
+#ifndef X11_ENABLED
+void keyboard_geometry_set(int x, int y, int width, int height);
+void keyboard_geometry_get(int *x, int *y, int *width, int *height);
+Eina_Bool keyboard_event_status(int x, int y);
+#endif
index e3837833cf51776b5be534990e3f23b652564a5d..26b7c65f2c7e52232aef19e80f45fb5f78ae12eb 100644 (file)
@@ -17,6 +17,9 @@
 #include "app_tracker.h"
 #include "screen_reader_tts.h"
 #include "logger.h"
+#ifndef X11_ENABLED
+#include "keyboard_tracker.h"
+#endif
 
 typedef struct {
        AtspiAccessible *base_root;
@@ -166,7 +169,17 @@ static void _on_atspi_event_cb(const AtspiEvent * event)
        }
 
        _print_event_object_info(event);
-
+#ifndef X11_ENABLED
+       if (!strcmp(event->type, "object:bounds-changed")
+               && (atspi_accessible_get_role(event->source, NULL) == ATSPI_ROLE_INPUT_METHOD_WINDOW)) {
+               AtspiRect *rect;
+               rect = (AtspiRect *)g_value_get_boxed(&event->any_data);
+               if (rect) {
+                       keyboard_geometry_set(rect->x, rect->y, rect->width, rect->height);
+                       DEBUG("keyboard_geometry: %d %d %d %d", rect->x, rect->y, rect->width, rect->height);
+               }
+       }
+#endif
        if (!strcmp(event->type, "object:property-change:accessible-name") && _object_has_highlighted_state(event->source)) {
                gchar *name = atspi_accessible_get_name(event->source, NULL);
                DEBUG("New name for object, read:%s", name);
index 343af004aec6cd14cce01e91a367ba5b2e757796..e5f7a5357c777325cfdc90dc3451975e11caea47 100644 (file)
@@ -45,6 +45,7 @@ static const AtspiRole interesting_roles[] = {
        ATSPI_ROLE_HEADER,
        ATSPI_ROLE_HEADING,
        ATSPI_ROLE_ICON,
+       ATSPI_ROLE_INPUT_METHOD_WINDOW,
        ATSPI_ROLE_ENTRY,
        ATSPI_ROLE_LABEL,
        ATSPI_ROLE_LINK,
@@ -181,6 +182,7 @@ static Eina_Bool _accept_object(AtspiAccessible * obj)
        case ATSPI_ROLE_PANEL:
        case ATSPI_ROLE_TREE_TABLE:
        case ATSPI_ROLE_PAGE_TAB_LIST:
+       case ATSPI_ROLE_INPUT_METHOD_WINDOW:
                return EINA_FALSE;
        case ATSPI_ROLE_DIALOG:
                if (!_has_escape_action(obj))
index 17e4e93c83cb1cc3d1652e09779195bf5de0b98a..5d40385f4fdea8cfe992557794613910ad3cb9f1 100644 (file)
 #include "screen_reader_tts.h"
 static AtspiDeviceListener *listener;
 static AtspiDeviceListener *async_listener;
+#ifndef X11_ENABLED
+static int keyboardX = 0;
+static int keyboardY = 0;
+static int keyboardW = 0;
+static int keyboardH = 0;
+#endif
 
 #ifndef X11_ENABLED
 static int prev_keyboard_state = VCONFKEY_ISF_INPUT_PANEL_STATE_HIDE;
@@ -229,3 +235,31 @@ void keyboard_tracker_shutdown(void)
 #endif
        DEBUG("keyboard tracker shutdown");
 }
+
+#ifndef X11_ENABLED
+void keyboard_geometry_set(int x, int y, int width, int height)
+{
+       keyboardX = x;
+       keyboardY = y;
+       keyboardW = width;
+       keyboardH = height;
+}
+
+void keyboard_geometry_get(int *x, int *y, int *width, int *height)
+{
+       *x = keyboardX;
+       *y = keyboardY;
+       *width = keyboardW;
+       *height = keyboardH;
+}
+
+Eina_Bool keyboard_event_status(int x, int y)
+{
+       if (prev_keyboard_state == VCONFKEY_ISF_INPUT_PANEL_STATE_SHOW) {
+               if ((y >= keyboardY) && (y <= (keyboardY + keyboardH)) && (x >= keyboardX) && (x <= (keyboardX + keyboardW))) {
+                       return EINA_TRUE;
+               }
+       }
+       return EINA_FALSE;
+}
+#endif
index 5d520945330dd35d22c43a458f31b18b6bade816..73951f14ac1b7702fa1afd318b9eca560646d8be 100644 (file)
@@ -2131,6 +2131,8 @@ static void on_gesture_detected(void *data, const Eldbus_Message *msg)
 {
 #ifdef X11_ENABLED
        Ecore_X_Window keyboard_win;
+#else
+       Eina_Bool keyboard_status;
 #endif
        DEBUG("In _on_gestures_detected callback");
        Gesture_Info *info = calloc(sizeof(Gesture_Info), 1);
@@ -2176,6 +2178,9 @@ static void on_gesture_detected(void *data, const Eldbus_Message *msg)
                                elm_access_adaptor_emit_read(keyboard_win, info->x_end, info->y_end);
                                break;
                        }
+#else
+                       keyboard_status = keyboard_event_status(info->x_end, info->y_end);
+                       if (keyboard_status) break;
 #endif
                        _focus_widget(info);
                }
@@ -2218,6 +2223,9 @@ static void on_gesture_detected(void *data, const Eldbus_Message *msg)
                        elm_access_adaptor_emit_read(keyboard_win, info->x_end, info->y_end);
                        break;
                }
+#else
+               keyboard_status = keyboard_event_status(info->x_end, info->y_end);
+               if (keyboard_status) break;
 #endif
                if (!prepared)
                        _focus_widget(info);
@@ -2229,6 +2237,9 @@ static void on_gesture_detected(void *data, const Eldbus_Message *msg)
                        elm_access_adaptor_emit_activate(keyboard_win, info->x_end, info->y_end);
                        break;
                }
+#else
+               keyboard_status = keyboard_event_status(info->x_end, info->y_end);
+               if (keyboard_status) break;
 #endif
                _activate_widget();
                break;