Fix no reaction on presing H/W volume button 44/124844/5
authorPawel Kurowski <p.kurowski2@samsung.com>
Wed, 12 Apr 2017 13:11:41 +0000 (15:11 +0200)
committerPawel Kurowski <p.kurowski2@samsung.com>
Thu, 20 Apr 2017 10:54:01 +0000 (12:54 +0200)
Fix double reading Quickpanel Window description

Change-Id: Iaa0016f9e5655a2ddc7c2d31a491704a49d96c53

src/navigator.c
src/window_tracker.c

index 570c8486be5751f7b9e6b4769f0eb1196492c868..efeff3f1b7b30f88295c1d08b7be5cb2f1454e01 100644 (file)
@@ -1997,8 +1997,6 @@ static void on_gesture_detected(void *data, const Eldbus_Message *msg)
 
 static void _view_content_changed(AtspiAccessible *root, void *user_data)
 {
-       AtspiRole role = -1;
-
        Service_Data *sd = (Service_Data*)user_data;
        if (sd == NULL) {
                ERROR("NULL context service_data");
@@ -2048,26 +2046,8 @@ static void _view_content_changed(AtspiAccessible *root, void *user_data)
 
        switch(atspi_accessible_get_role(root, NULL))
        {
-       case ATSPI_ROLE_WINDOW :
-               role = atspi_accessible_get_role(flat_navi_context_current_get(sd->flat_navi_context), NULL);
-               if(role == ATSPI_ROLE_PAGE_TAB ||       //add more roles...
-                       role == ATSPI_ROLE_PAGE_TAB_LIST)
-               {
-                       _current_highlight_object_set(nd, vconf_data, haptic_data, tts_data, flat_navi_context_current_get(sd->flat_navi_context), HIGHLIGHT_FIRST);
-               }
-               else
-               {
-                       char *description = NULL;
-                       description = atspi_accessible_get_description(root, NULL);
-                       if(!strcmp(description,"\0"))
-                               description = generate_what_to_read(root, vconf_data);
-
-                       tts_speak(description, EINA_TRUE, tts_data);
-                       free(description);
-               }
-               break;
        case ATSPI_ROLE_POPUP_MENU:
-       case ATSPI_ROLE_DIALOG :
+       case ATSPI_ROLE_DIALOG:
                _current_highlight_object_set(nd, vconf_data, haptic_data, tts_data, flat_navi_context_current_get(sd->flat_navi_context), HIGHLIGHT_FIRST);
                break;
        default :
index a554bf6c7481d90e5aba2d836f73bddc067c33ee..a7f1fa9605e2502ef7bd948b4171cbf6db1598e3 100644 (file)
@@ -34,6 +34,11 @@ struct _Window_Tracker_Data
 
 static void _on_atspi_window_cb(const AtspiEvent *event)
 {
+       if (!event || !event->type || !event->source) {
+               ERROR("NULL event");
+               return;
+       }
+
        Service_Data *sd = get_pointer_to_service_data_struct();
        if (!sd) {
                ERROR("NULL context");
@@ -47,11 +52,15 @@ static void _on_atspi_window_cb(const AtspiEvent *event)
        }
 
        gchar *name = atspi_accessible_get_name(event->source, NULL);
+       if (!name) {
+               ERROR("NULL name");
+               return;
+       }
        Window_Tracker_Cb user_cb = wtd->user_cb;
 
        DEBUG("Event: %s: %s", event->type, name);
 
-       if (!strcmp(event->type, "window:activate") && wtd->last_active_win != event->source)   //if we got activate 2 times
+       if (!strcmp(event->type, "window:activate"))
        {
                if (wtd->user_cb)
                        user_cb(wtd->user_data, event->source);
@@ -59,7 +68,7 @@ static void _on_atspi_window_cb(const AtspiEvent *event)
                wtd->top_win = wtd->last_active_win;
        }
 
-       if (!strcmp(event->type, "object:state-changed:visible") && !strcmp(name, "Quickpanel Window"))
+       if (!strcmp(event->type, "object:state-changed:visible") && (!strcmp(name, "Quickpanel Window") || !strcmp(name, "volume")))
        {
                if (event->detail1)
                {